Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCL:Why Pointer to a pointer cannot be passed as an argument to a kernel function?

Tags:

opencv

opencl

Hi, I just want some clarification on Why we can not pass the 2D array pointer as argument to the kernel . Why it is not allowed . What will happen if I use this as argument (Internally??as I know the code will give some error) .

Please do the needful .

like image 374
Ashwin Avatar asked Apr 28 '26 17:04

Ashwin


1 Answers

Because in OpenCL 1.x the device has a separate address space. Kernels executing on the device wouldn't know what to do with a pointer that is only useful in host address space.

Note that in OpenCL 2.0 Shared Virtual Memory (SVM) removes this restriction and allows buffers containing pointers to be used on both host and device side.

like image 194
Dithermaster Avatar answered May 02 '26 15:05

Dithermaster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!