Forum Discussion
Hi,
You do not need to pass nd_item<1> to your kernel for the single work-item kernel, i.e., h.single_task lambda function. In this programming model you only have one single work-item within one work-group running on FPGA thus, you don't have to get the get_local_id(0), get_group(0), and get_local_range(0) because these values are equal to 0. Instead, you need to use "for" loops (or any other loop) to process your data in your lambda function. You will have something like that:
h.single_task<class bude_kernel>([=]()[[intel::kernel_args_restrict]]{
for(size_t id = 0; id < global; id++){ // I'm assuming that "global" is the size of the problem.
ix = // It is up to you to compute this value from your "id."
.
.
.
}
You have only one "for" loop because nd_item was one. If nd_item was N, then you will have N nested loops. Although, nested loops can be fused into one loop also.
I hope this clarifies things for you!
Regards,
Daouda