The following kernel give wrong result -
kernel void
ker(float in1[ ], float in2[ ], out float out1< > )
{
int pos_x = instance().x;
int i = pos_x >> 1;
float t;
if(pos_x & 0x01) {
t = in2[i ];
} else {
t = in1[i ];
}
// Some operations with t
out1 = t;
}
But, making a small change produces expected result-
kernel void
ker(float in1[ ], float in2[ ], out float out1< > )
{
int pos_x = instance().x;
int i = pos_x >> 1;
float t;
if(pos_x & 0x01) {
t = in2[i ];
} else {
t = 3.0f;
}
// Some operations with t
out1 = t;
}
Test case