我正在尝试使用 iso_c_bindings 模块将 Fortran 2003 绑定编写到 CUFFT 库,但我遇到了cufftPlanMany
子例程问题(类似于sfftw_plan_many_dft
FFTW 库中的问题)。
绑定本身如下所示:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! cufftResult cufftPlanMany(cufftHandle *plan, int rank, int *n,
! int *inembed, int istride, int idist,
! int *onembed, int ostride, int odist,
! cufftType type, int batch)
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
interface cufftPlanMany
subroutine cufftPlanMany(plan, rank, n, &
inembed, istride, idist, &
onembed, ostride, odist, &
type, batch) &
& bind(C,name='cufftPlanMany')
use iso_c_binding
integer(c_int):: plan
integer(c_int),value:: rank, type, batch
integer(c_int):: n(*)
integer(c_int),value:: istride, idist, ostride, odist
integer(c_int):: inembed(*), onembed(*)
end subroutine cufftPlanMany
end interface cufftPlanMany
调用部分如下所示:
integer(c_int):: plan
integer(c_int):: batch
integer(c_size_t):: size
! ...
call cufftPlanMany(plan, 1, size,&
0, 1, size,&
0, 1, size,&
CUFFT_C2C, batch)
不幸的是,试图编译这个结果
错误:在 (1) 处没有通用“cufftplanmany”的特定子程序
编译错误。尝试使用变量代替常量也无济于事。你能帮忙调试一下吗?
使用的编译器是gfortran:GNU Fortran (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5