You can absolutely pass multi-dimensional arrays to kernels. When you pass in a buffer, it is just a bunch of data that you can use however you want inside the kernel. What you can not do is pass in an array of cl_mem objects (buffers or images).
With regards to “true” heterogeneous computation, the OpenCL spec allows you to execute kernels on any supported device in your system. So this is “true” heterogeneous computation, but it is not, is “automatic” heterogeneous computation. (E.g., the developer will still have to determine how to split the work across the supported devices, but OpenCL will allow them to all be used together.)
You can absolutely pass multi-dimensional arrays to kernels. When you pass in a buffer, it is just a bunch of data that you can use however you want inside the kernel. What you can not do is pass in an array of cl_mem objects (buffers or images).
I think I differ here. CL_MEM can hold data… that is uni-dimensional. In CUDA, I could technically create an “int **a” on the device… So, “a” points to an array of pointers each of which point to an array of integers… I cant replicate that with OpenCL.
But arrays like int “a[100][100]” can be replicated once we know if it is row_major or column_major.
With regards to “true” heterogeneous computation, the OpenCL spec allows you to execute kernels on any supported device in your system
Not really. The spec does NOT spell out the Platform layer. Each vendor comes out with his own version of clFindDevices and so on…
Therez no device manager layer outlined by the spec at all. Thus true heterogeneous computing is still out of reach.
Just to clarify, is it allowable under the 1.0 standard that separate kernel executions passed the same cl_mem object may provide to the kernel different pointer values for this object? The spec does not seem to explicitly specify one way or the other.
(If the pointer values passed for cl_mem objects were guaranteed to always be the same, then it should be possible to arrange for pointer-based data structures to persist between kernel calls.)
It is certainly possible that separate kernel executions passed the same cl_mem object may result in different pointer values for this memory object in the kernel. Consider for example if memory usage results in memory objects being punted from the device’s memory. In this case, there is no guarantee that the cl_mem object will be the same pointer value across multiple kernel executions.