diapolo

vector comparison - how to?

Discussion created by diapolo on Jan 14, 2010
Latest reply on Jan 18, 2010 by genaganna

I´m pretty sure this is (again) a very simple question for the advanced coders here, but it´s driving me nuts.

I want to compare to vectors and do sth. if they are equal.

Thanks for your help,

Dia

__kernel void test(__constant uint *passedInt4Arr, __global uint *out) { constant uint4* passedInt4Arr_vec4 = (__constant uint4*) passedInt4Arr; uint4 Vec4 = (uint4)(1, 2, 3, 4); // any way to do a direct vector comparison? compiler throws me errors if passedInt4Arr_vec4 == Vec4 is used if(passedInt4Arr_vec4[0].x == Vec4.x && passedInt4Arr_vec4[0].y == Vec4.y && passedInt4Arr_vec4[0].z == Vec4.z && passedInt4Arr_vec4[0].w == Vec4) { do_sth(); } }

Outcomes