You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to call the fftw3 library using dpp however there is an issue with type translation in particular with function definitions. Within the C library mentioned, consider the function fftw_plan_dft_1d, within the library documentation the type signature is:
fftw_plan fftw_plan_dft_1d(int n, fftw_complex *in, fftw_complex *out,
int sign, unsigned flags);
Error: function `fftw_plan_dft_1d(int, double**, double**, int, uint)` is not
callable using argument types `(int, double[2]*, double[2]*, int, uint)`
Though double* is a generalization of double[2] in this case the substitution is undesirable, not only because it contravenes Data Type Compatibiity as defined in D's spec, and prevents the programmer from using the correct type alias for fftw_complex which is actually safer, but also because it looses type information, and where it to be the case where it inserted the correct aternative double[2] for fftw_complex some flexibility in controlling the behaviour of fftw_complex over the whole library is lost. Also attemping to using double* as fftw_complex could cause the function not to work at all (this has happened to me).
For me the issue is not a show stopper because I'm using dstep and direct translation methods.
All the best.
Thank you
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to call the fftw3 library using dpp however there is an issue with type translation in particular with function definitions. Within the C library mentioned, consider the function
fftw_plan_dft_1d
, within the library documentation the type signature is:where
fftw_complex
is defined byThe dpp library correctly converts the type
fftw_complex
ashowever incorrectly converts the function signature to:
and the compiler gives an error:
Though
double*
is a generalization ofdouble[2]
in this case the substitution is undesirable, not only because it contravenes Data Type Compatibiity as defined in D's spec, and prevents the programmer from using the correct type alias forfftw_complex
which is actually safer, but also because it looses type information, and where it to be the case where it inserted the correct aternativedouble[2]
forfftw_complex
some flexibility in controlling the behaviour offftw_complex
over the whole library is lost. Also attemping to usingdouble*
asfftw_complex
could cause the function not to work at all (this has happened to me).For me the issue is not a show stopper because I'm using dstep and direct translation methods.
All the best.
Thank you
The text was updated successfully, but these errors were encountered: