Login  Register

Re: Hardcoded float not working?

Posted by Mat000 on Mar 10, 2015; 9:13am
URL: https://forum.jogamp.org/Hardcoded-float-not-working-tp4030974p4034131.html

Miha wrote
compiler somehow recognizes all hardcoded floats as integers.
for those who will find it (after driving nuts for a few days)

the problem is not in JOCL (I used JavaCL) nor in Java (although Java7 and Java6 behave differently).
It's definitely a bug in the AMD OpenCL compiler for Linux. It also appears under various circumstances:

bug in OpenCL parser depend on locale $LANG
Kernel fail with other than en_US locale
Floating Point Bug in OpenCL via ssh
CodeXL truncate float on when profiling openCL


To solve the issue set the environment variable LC_NUMERIC=C

You can also try your code in the clean environment: env -i java <args>