Sheeep

float4+local memory

Discussion created by Sheeep on Jul 22, 2010
Latest reply on Jul 23, 2010 by LeeHowes
is it possible to use vload4/vstore4 with local memory?

Hi,

I try to build a vector from local memory, and get an error:

 

 

error: no matching overload found for arguments of type 'size_t, float __attribute__((address_space(3)))[4]'

        x4=vload4(lid,x);

           ^~~~~~

 

 

Is it possible to create a vector from local memory like I tried in the kernel below?

 

__kernel void test3(__global const float *a, __global const float *b, __global float *c){ int gid=get_global_id(0); int lid=get_local_id(0); __local float x[4],y[4]; x[lid] = a[gid]; y[lid] = b[gid]; float4 x4,y4,z4; x4=vload4(lid,x); y4=vload4(lid,y); z4=x4+y4; vstore4(z4,gid,c); }

Outcomes