OpenCL 中内核参数数量的限制
我想知道 OpenCL 中设置为内核函数的参数数量是否有限制。我在设置参数时收到 INVALID_ARG_INDEX 错误。我在内核函数中设置 9 个参数。请在这方面帮助我。
I wanted to know if there is any limit on the number of arguments that are set to kernel function in OpenCL. I am getting the error as INVALID_ARG_INDEX while setting arguments. I am setting 9 arguments in the kernel function. Please help me in this regard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试调用以下函数: www.khronos .org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html
唯一的参数限制似乎令人担忧:
-CL_DEVICE_MAX_CONSTANT_ARGS(指向 __constant 内存空间的指针的参数)
-CL_DEVICE_MAX_READ_IMAGE_ARGS
-CL_DEVICE_MAX_WRITE_IMAGE_ARGS
最大读取图像参数计数应该不是问题,但是最大常量参数计数和最大写入图像参数计数在所有设备上应至少为 8。例如,我可能会在只接受 8 个的设备上传递 9 个写入图像......
You might try calling the following function: www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html
The only argument limits seem to concern:
-CL_DEVICE_MAX_CONSTANT_ARGS (arguments which are pointers to the __constant memory space)
-CL_DEVICE_MAX_READ_IMAGE_ARGS
-CL_DEVICE_MAX_WRITE_IMAGE_ARGS
Max read image arguments count should not be a problem, however max constant arguments count and max write image arguments count should be at least 8 on all devices. I might be that you are passing 9 write images on a device that only accepts 8, for example...