bubu

vstore doubt

Discussion created by bubu on Jun 1, 2010
Latest reply on Jun 10, 2010 by Raistmer

Should I write this using vstore in a GPU?

 

__kernel main ( __global float4 *outb )

{

       const int x = get_global_id(0);
       const int y = get_global_id(1);

       const width = get_global_size(0);

       const float4 data = ...

      outb[y*width+x] = data;

}

 

or

 

__kernel main ( __global float4 *outb )

{

       const int x = get_global_id(0);
       const int y = get_global_id(1);

       const width = get_global_size(0);

 

       const float4 data = ...;

       vstore4 ( data, 16*(y*width+x), (__global float*)outb );

}

 

???

(in that way would run efficiently in GPU and  CPU ).

 

And what's the #define to know the ATI's OpenCL implementation is using the CPU? #ifdef ATI_OPENCL_CPU ?

thx

 

Outcomes