clEnqueTask showing deprecated in openCL 2.0

六月ゝ 毕业季﹏ 提交于 2020-01-02 07:09:20

问题


I am trying to build a hello world program in Visual Studio using OpenCL AMD SDK, but it is saying that a few commands are deprecated. I tried to define a macro CL_USE_DEPRECATED_OPENCL_1_2_APIS, but it's still not working. What do I need to do?

For the code I referred to : https://www.fixstars.com/en/opencl/book/OpenCLProgrammingBook/first-opencl-program/


回答1:


Yoink! Stealing DarkZeros comment.

From https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clEnqueueTask.html we read:

clEnqueueTask is equivalent to calling clEnqueueNDRangeKernel with work_dim = 1, global_work_offset = NULL, global_work_size[0] set to 1, and local_work_size[0] set to 1.

Replace your clEnqueueTask with clEnqueueNDRangeKernel as described above.



来源:https://stackoverflow.com/questions/36816301/clenquetask-showing-deprecated-in-opencl-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!