# Does long double  is supported in  pgcc 17.10-0 64-bit

**URL:** <https://forums.developer.nvidia.com/t/does-long-double-is-supported-in-pgcc-17-10-0-64-bit/135631>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [March 22, 2018, 2:59am UTC](https://forums.developer.nvidia.com/t/does-long-double-is-supported-in-pgcc-17-10-0-64-bit/135631 "2018-03-22T02:59:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![azzulrd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@azzulrd](https://forums.developer.nvidia.com/u/azzulrd)\
**Post date:** [March 22, 2018, 2:59am UTC](https://forums.developer.nvidia.com/t/does-long-double-is-supported-in-pgcc-17-10-0-64-bit/135631/1 "2018-03-22T02:59:00Z")

</div>

Hi There,

I am trying with long double datatype, however I got this messages when compile  
Accelerator restriction: datatype not supported: x  
I read a question similar with double.

The basic Code:

int main (int argc, char \*\*argv)  
{  
int N = 1\<\<20; // 1 million long doubles

if (argc \> 1)  
N = atoi(argv[1]);

long double \*x=( long double _)malloc(N_sizeof( long double));  
long double \*d=( long double _)malloc(N_sizeof( long double));

for (int i=0; i \< N; ++i) {  
x\_=2.00;  
d=1.00;  
}  
saxpy(N,3.00,x,d);  
return 0;  
}  
  
void saxpy(int n, long double a, long double \*restrict x, long double _restrict y)  
{  
int k;  
 #pragma acc kernels  
for (k=0; k\<n; ++k)  
x[k] = a_y[k]+x[k];  
}  
  
  
  
There is no problem with float and double, but long double.  
  
Any suggestion?\_

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [March 22, 2018, 3:40pm UTC](https://forums.developer.nvidia.com/t/does-long-double-is-supported-in-pgcc-17-10-0-64-bit/135631/2 "2018-03-22T15:40:41Z")

</div>

Same answer as your other post: [SoA by reference](https://forums.developer.nvidia.com/t/soa-by-reference/135632/1)

Sorry, no. GPUs don’t support 80-bit (or 128-bit) double precision floating point values so “long double” can’t be used in device code.

We could demote 80-bit to 64-bit as CUDA does, but this would give divergent answers between host and device code which is not ideal.

-Mat

---

<div class="post-metadata">

**Author:** ![azzulrd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@azzulrd](https://forums.developer.nvidia.com/u/azzulrd)\
**Post date:** [March 23, 2018, 1:57am UTC](https://forums.developer.nvidia.com/t/does-long-double-is-supported-in-pgcc-17-10-0-64-bit/135631/3 "2018-03-23T01:57:49Z")

</div>

Mat,

Thanks so much for your fast answer.
