compiled on an Athlon64 X2
float4 n = cross( ab, -ca ) ;
n = normalize( n ); // result fucks up this line ==> n = (NaN,NaN,NaN,NaN)
n.xyz is computed corectly but n.w is not 0 as per spec. but NaN. But only some of the time.
More specifically, for some builds of the same kernel it works and for some it doesn't.
I build the same Cl program multiple times with different compile-time constants (subproblem size) as build options. The compiletime constant has no influence on the parameters of the "cross" call though, it is related to other parts of the code.
There is one problematic subproblem size lets say it's 6.
If I define a
clBuildProgram( ... , "-D SUBSIZE=N", ... )
// setup Kernel parameter
// run Kernel
// evaluate results
The undefined behavior happens whenever I run multiple testcases like
but not in
I know I can work arround te problem by simply setting the n.w = 0.0; but this undefined behavior makes me nervous and I'd like to know what's going on.