Limit the number of kernel arguments in OpenCL

I wanted to know if there is a limit on the number of arguments that are set for the kernel function in OpenCL. I get an error like INVALID_ARG_INDEX when setting the arguments. I set 9 arguments to the kernel function. Please help me in this regard.

+4
source share
1 answer

You can try calling the following function: www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html

It seems that only the arguments are limited: -CL_DEVICE_MAX_CONSTANT_ARGS (arguments pointing to __constant memory space) -CL_DEVICE_MAX_READ_IMAGE_ARGS -CL_DEVICE_MAX_WRITE_IMAGE_ARGS

The maximum number of arguments to read images should not be a problem, however, the maximum number of arguments to counters and the maximum number of arguments to write images should be at least 8 on all devices. It is possible that you transfer 9 images on a device that only accepts 8, for example ...

+8
source

Source: https://habr.com/ru/post/1304843/


All Articles