I am trying to use GNU decimal floats with NVCC and I get the following error:
/usr/include/c++/4.8/decimal/decimal(230): error: invalid argument to attribute "mode"
The affected line is the following:
typedef float __decfloat32 __attribute__((mode(SD)));
I assume that NVCC does not support SD as an argument for mode. Is there any workaround or it is just not possible with NVCC? The code works well when compiling for CPU.
How/where is this SD defined?
Thanks!
Update: I could find where SD is defined for GCC. Two great answers here:
What does GCC __attribute__((mode(XX)) actually do?
For GCC: gcc/gcc/machmode.def
/* Decimal floating point modes. */
DECIMAL_FLOAT_MODE (SD, 4, decimal_single_format);
DECIMAL_FLOAT_MODE (DD, 8, decimal_double_format);
DECIMAL_FLOAT_MODE (TD, 16, decimal_quad_format);
Isolating the host code in a *.cpp file works ok. Once the code goes into a *.cu, NVCC is used and it doesn't compile anymore. I can keep device/host code apart but I was investigating how the GCC decimal library works internally in combination with NVCC.
Where can I find more information about NVCC connected to this?