Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎09-01-2020

Host Program Stuck After OpenCL enqueue task

Wondering if anyone ever encounter this problem.

I wrote a host program and a kernel using HLS.

However, after the kernel was enqueued to the task queue, the program hangs.

I did not received any error message so its quite hard for me to figure out what happened...

The program can reach the line to print " task enqueued for CU# 0" but cannot reached q.finish()

Any guess or suggestion will be appreciated, got no clue now.

I attached my codes if anyone is willing to take a look, thanks again.



//Launch the kernel
            for(int i = 0; i < num_cu; i++)
                #ifdef DEBUG
                cout << "equeue task for CU#" << i << endl;
                int pidx = (iter*num_cu + i);
                OCL_CHECK(err, err = krnls[i].setArg(7, pidx )); //pindex
                #ifdef DEBUG
                cout << "argument set, enquing task for CU#" << i << endl;
                OCL_CHECK(err, err = q.enqueueTask(krnls[i]));
                #ifdef DEBUG
                cout << "task enqueued for CU#" << i << endl;
        OCL_CHECK(err, err = q.finish());
        #ifdef DEBUG
                cout << "finish computation" << endl;




0 Kudos
1 Reply
Registered: ‎03-01-2020

I did a quick compile of your kernel code. Vivado HLS seems to estimate an operating frequency of ~5 MHz which is quite low and points to a very long critical path in your design. Have you checked the post-place-and-route frequency of your design? Moreover, two of the loops in your kernel are not pipelined with an II of one. I think it is possible that your kernel is not getting stuck; it could be just too slow which makes you think it is stuck.


The only cases I have come across which results in a kernel getting stuck are bugs in the compiler (quite rare) and incorrect use of HLS streams (which don't exist in your code as far as I can see).

0 Kudos