Just tracked down a problem in a huge OpenCL kernel and found out, that min(1.0f, NAN) evaluates different on CPU and GPU.
- Gentoo Linux
- fglrx 11.2
- app-sdk 2.3
- Core2 Duo
The problem appears also with this test snipped of kernel code:
__kernel void test(__global float * out)
out = min(1.0f, NAN);
On GPU out contains 1.0f after the call, on CPU its nan.
The OpenCL Spec only contains a definition for fmin (which works as it should).
Is the behaviour of min intentionally undefined by the OpenCL Spec and AMDs implementation or is this a bug?