The subject line says it all really. My very first test with the new OpenCL vector support was a simple summation loop:
float4 sum( unsigned count, float4 const data[] )
{
float4 sum = 0;
#pragma MUST_ITERATE( 1 )
for( unsigned i = 0; i < count; i++ )
sum += data[i];
return sum;
}
which resulted in
>>>> Optimizer terminated abnormally >>>> in function _Z3sumjPKU11__cl_vector4_f() >>>> in file "test.cc" >> Compilation failure
Similar result for other floating-point vector types, but integer types worked. I'm targeting c674x but I also tried compiling for c6600, same result.
The problem turned out to be the initializer, using one of these instead solves the problem:
float4 sum = (float4)( 0, 0, 0, 0 ); float4 sum = (float) 0; float4 sum = 0.;