AnsweredAssumed Answered

i.MX6: Impossible to pass NULL buffer objects to clSetKernelArg()

Question asked by Benoit Thebaudeau on Jun 11, 2014



In the Vivante GPU package from i.MX6 BSP 3.0.35-4.1.0, passing NULL or a pointer thereto to clSetKernelArg() for a kernel buffer object argument (e.g. '__global uchar *buf') results in a segmentation fault.


This is a bug since, according to § "5.7.2 Setting Kernel Arguments":

If the argument is a buffer object, the arg_value pointer can be NULL or point to a NULL value in which case a NULL value will be used as the value for the argument declared as a pointer to __global or __constant memory in the kernel.


This is the only way of passing a NULL pointer to a kernel, so there is no workaround, apart from adding a kernel argument telling not to use the passed pointer, which anyway compels to create a dummy buffer object when not needed, but this one can be small.


I have not tested this issue with the Yocto release, but I have found nothing in the release notes indicating that such a bug has been fixed. Does anyone know?