[Beignet] [BUG]Unused sampler_t in kernel function get wrong arg_size on 64bit system

Zhigang Gong zhigang.gong at linux.intel.com
Sun Jun 9 00:40:21 PDT 2013


Ruiling,

Thanks for reporting this bug. But it may not be easy to fix with llvm 3.2/3.1.
As 3.2/3.1 doesn't define sampler_t as a keyword, we have to define sampler_t
as normal integer type. And when it is used in a read_image function, we fix it
type to sampler_t. Now as you defined the argument but never use it, then we
don't have a chance to correct the argument type. And latter when you set a sampler_t
argument at host side, it triggers this bug on 64 bit system.

I will fix it with llvm 3.3. But may not fix it for the previous version of llvm.

On Sun, Jun 09, 2013 at 03:24:01AM +0000, Song, Ruiling wrote:
> If write a kernel function declare a sampler_t without using the sampler.
> 
> __kernel void kernel_func(sampler_t sp) { }
> 
> When user tries to set it using clSetKernelArg(k,0, sizeof(cl_sampler), &sampler), he will get INVALID_ARG_SIZE error.
> The reason looks like the kernel argument was processed as FunctionArgument::VALUE instead of FunctionArgument::SAMPLER.
> So, user passed sizeof(cl_sampler) which is 8, but the arg_size get from kernel is 4 on 64bit system.
> 
> This bug comes from PIGLIT api test cl-set-kernel-arg.
> 
> Thanks!
> Ruiling
> 

> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list