Is it valid to convert an scale type array into a vector type and do operations?

Discussion created by zhuzxy on Aug 26, 2011
Latest reply on Aug 27, 2011 by notzed

Not sure if it is proper forum to ask questions. If not, please ignore it.

For the AMD OpenCL code, we know vector operates more efficently.  And during my calculation, I have a int array, e.g. int value[100], I want to do add operations to continuous 4 array elements. like value[11] += 2; value[12]+=3 ...

when I wrote code like the following:

   int4 *tmp = &value[11];

   *tmp += (int4)(2,3,4,5);

the final results shows it does not work. Does AMD opencl support such scale ->vector cast and operations?