- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:\Codice\IterSolver_v14x1\MGM.F90 902
Is there anything I can do?
Alessandro
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:\Codice\IterSolver_v14x1\MGM.F90 902
Is there anything I can do?
Alessandro
コピーされたリンク
4 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Alessandro
Hi,
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:CodiceIterSolver_v14x1MGM.F90 902
Is there anything I can do?
Alessandro
I have a program that can work in single or double precision, depending on the value of the variable kvar which may be sgl or dbl (4 or 8). I have some routines that accept only a specific kind though, and I tried the following:
complex(kind=kvar) G_fft
...
if (kvar.eq.dbl) then
! do nothing
elseif (kvar.eq.sgl) then
call transfer_c(G_fft,dv_Gfft,.true.)
endif
When I try to compile it with kvar set to dbl it gives me the following error:
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [G_FFT] E:CodiceIterSolver_v14x1MGM.F90 902
Is there anything I can do?
Alessandro
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Andrew Smith
I dont know what transfer_c does but if it similar to the Fortran transfer function then it would not be suitable. Why not try: dv_Gfft = G_fft
It's a wrapper for CUDA, dv_Gfft is more like a struct, and transfer_c deals with the transfer of the data into the variable of the device.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Quoting - Alessandro
It's a wrapper for CUDA, dv_Gfft is more like a struct, and transfer_c deals with the transfer of the data into the variable of the device.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
If I understand you correctly, the code compiles if kvar ist set to sgl. As the value of kvar has to be known at compile time anyway, the simplest solution seems to be to use conditional compilation:
#ifdef SGLPREC
call transfer_c(G_fft,dv_Gfft,.true.)
#endif
You could define your parameter kvar like this:
#ifdef SGLPREC
call transfer_c(G_fft,dv_Gfft,.true.)
#endif
You could define your parameter kvar like this:
integer, parameter :: kvar = sgl
#else
integer, parameter :: kvar = dbl
#endif
To compile the program with single precision:
ifort -fpp -DSGLPREC [...]
and with double precision:
ifort -fpp [...]
