The following code:
// test.cu
#include <stdio.h>
#include <complex.h>
int main() {
float _Complex x = 0.0f + 1.0f*_Complex_I;
}
$ nvcc test.cu
Gives the compilation error:
test.cu(5): error: user-defined literal operator not found
1 error detected in the compilation of "/tmp/tmpxft_00007220_00000000-8_test.cpp1.ii".
While gcc and g++ compile perfectly fine
My nvcc version is:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
Is there a widely accepted way to use complex numbers?