This is a know problem, and actually mentioned in the release notes.
brcc chops down any double literal to float, even outside of kernels.
As far as workarounds go, how about this (I haven't tried it, but it should work):
- In a separate c++ source file create a double array and initialize it
with your double constants. Compile this using the C++ compiler, not brcc.
- In your .br file, reference the array as an extern, and do a streamRead
of it into a gather stream. Pass the gather stream to your kernel as an
input parameter, and access your constants as gather stream elements.
This trick also lets you work around brcc correctness issues with passing multiple double vars to a kernel.
There may be performance implications vs. using float constants, I'm not sure.
-- marcr