Cuda6 and quad-precision (float128) on host

Hi,

I’m trying to implement some high precision code using the dbldbl headers and I’m running into a strange problem on the host side and I was wondering if anyone had any advice. I’m running linux and using cuda RC6 and gcc 4.8.1 with the quadmath library (and ideally using the boost float128 datatype). The basic idea is to do a calculation on the gpu using the dbldbl type, transfer the result to a __float128 (or float128) and do some host-side calculations on it. However, if I try to include the <quadmath.h> header in a .cu file I get compilation errors, starting with this:

/usr/lib/gcc/x86_64-linux-gnu/4.8/include/quadmath.h(32): error: invalid argument to attribute “mode”

/usr/lib/gcc/x86_64-linux-gnu/4.8/include/quadmath.h(43): error: identifier “__float128” is undefined

However, if I put the quadmath stuff into a separate .cpp file then I can compile and link and everything is hunky-dory. This is a possible solution but will require a rewrite (which might be worth doing anyway, but that’s another story).

So, my question is, is it possible to use quad-precision variables (on the host only) inside of a .cu file?

Thanks for any input,
Eric

__float128 isn’t supported by nvcc.

It’s an explicit exception mentioned in the compiler release notes.
“** (Linux) The __float128 data type is not supported for the gcc host compiler.”

As you said though, you can use a separate .cpp file as an annoying but functional workaround.

I really love gcc’s __float128 myself… I sometimes use it as a slow, hacky double-check of my math code to make sure I’m not losing due to precision. Higher order spherical harmonics are especially precision sensitive.

So it seems there is some difference between Windows and Linux when using float128.

So it seems there is some difference between Windows and Linux when using float128.

Thanks SPWorley,

I see that in CUDA5 and 5.5 but I didn’t find it in the release notes for 6RC so I was hoping that it had perhaps been fixed. Alas, it seems the answer is no. Any idea what the hold-up is?

Eric