I would like to know if in clEnqueueNativeKernels, there is supposed to be a one-to-one correspondence between the memory objects handles passed in mem_list and the argument pointers passed in args_mem_loc.
To put it in another way: if I cast every args_mem_loc[i] to a cl_mem* and access the data which these pointers refer to, can I expect to retrieve the contents of mem_list (possibly not in the same order)?
My gut feeling is that it should be the case, because there is only one num_mem_objects parameter for array sizes, which means that the implementation can only know the size of both mem_list and args_mem_loc if it is identical. But the spec is not very clear about this, so I wanted to be sure before simplifying this apparent information redundancy away in a library I’m writing.
The relevant description is located pp. 247-248 of the OpenCL 2.1 spec. Or alternatively, for NVidia users like me, pp. 176-177 of the OpenCL 1.2 spec.