How can I print a variable of type cufftDoubleComplex
in CUDA C++, I tried doing this using printf
:
cufftDoubleComplex Fd;
printf("%f", Fd); //not working
but I got this error and it didn't work during runtime:
warning C4477: 'printf' : format string '%f' requires an argument of type 'double', but variadic argument 1 has type 'cufftDoubleComplex'
How can I print it? What is the proper format string to use inside printf
?
cuComplex.h
suggests thecuCreal()
andcuCimag()
functions for accessing the real and imaginary parts of a CUDA complex number. Printing those is trivial. – Shawnprintf
format specifiers for complex data types. A complex number comprises a real and imaginary part. You need to retrieve the two parts and print them separately. Header filecuComplex.h
exportscuCreal()
andcuCimag()
for this purpose. – njuffa