我正在尝试在opencl应用程序的嵌套for循环中编码,我将其视为二维问题。全局工作大小不是block_dimension的倍数,因此我声明了大小:
size_t global_work_size[2] = {length1,length2};
size_t local_work_size[2] = {NULL,NULL};
err = clEnqueueNDRangeKernel(commands, Kernel, 2, NULL, global_work_size, local_work_size, 0, NULL, NULL);
我收到CL_INVALID_WORK_SIZE错误。我应该如何改变我当地的工作规模?
答案 0 :(得分:1)
Juste像这样调用内核:
err = clEnqueueNDRangeKernel(commands, Kernel, 2, NULL, global_size, NULL, 0, NULL, NULL);