Re: Hardcoded float not working?
Posted by Wade Walker on Dec 22, 2013; 11:07pm
URL: https://forum.jogamp.org/Hardcoded-float-not-working-tp4030974p4031026.html
This is very confusing. The fact that "a[index]=1/(float)2" works but "a[index]=0.5f" doesn't work implies that it must be a problem with the OpenCL compiler itself, rather than JOCL. If JOCL didn't work (e.g. if it was somehow setting the result buffer to zero) then changing the OpenCL kernel would make no difference, it would be the same result either way.
The only way I can think of for the OpenCL compiler to be wrong is if you're somehow using an old version. Since it works from C++, this implies that only JOCL is seeing the old version. Have you tried -Djogamp.debug.NativeLibrary.Lookup and -Djogamp.debug.NativeLibrary as suggested by Xerxes? These should show you which library JOCL uses, and it should match the one printed by "ldd your-binary" on your C++ test executable.