1
votes

Instead of using 'setKernelArg' for passing the parameter to the kernel function, can we use extern??

for example:

cl_mem countMobj;     //device variable

Suppose I have to pass this variable to the kernel function. Can I declare storage class specifier extern to pass the address instead of passing by 'setKernelArg'??

1

1 Answers

1
votes

No. The host C/C++ compiler does not know that something like an OpenCL device with its own address space exists.