MODULE cuda_fft_interfaces !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: cuda_fft_interfaces.f90 1112 2013-03-09 00:34:37Z witha $ ! ! 1111 2013-03-08 23:54:10Z raasch ! idata and odata changed from 1d- to 3d-arrays ! ! 1106 2013-03-04 05:31:38Z raasch ! Initial revision ! ! Description: ! ------------ ! FORTRAN interfaces for the CUDA fft ! Routines for the fft along x and y (forward/backward) using the CUDA fft !--------------------------------------------------------------------------------! #if defined ( __cuda_fft ) INTEGER :: CUFFT_FORWARD = -1, & CUFFT_INVERSE = 1, & CUFFT_R2C = Z'2a', & ! Real to Complex (interleaved) CUFFT_C2R = Z'2c', & ! Complex (interleaved) to Real CUFFT_C2C = Z'29', & ! Complex to Complex, interleaved CUFFT_D2Z = Z'6a', & ! Double to Double-Complex CUFFT_Z2D = Z'6c', & ! Double-Complex to Double CUFFT_Z2Z = Z'69' ! Double-Complex to Double-Complex PUBLIC ! !-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch ) INTERFACE CUFFTPLAN1D SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' ) USE ISO_C_BINDING INTEGER(C_INT) :: plan INTEGER(C_INT), value :: batch, nx, type END SUBROUTINE CUFFTPLAN1D END INTERFACE CUFFTPLAN1D ! !-- cufftDestroy( cufftHandle plan ) !!! remove later if not really needed !!! INTERFACE CUFFTDESTROY SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' ) USE ISO_C_BINDING INTEGER(C_INT), value :: plan END SUBROUTINE CUFFTDESTROY END INTERFACE CUFFTDESTROY INTERFACE CUFFTEXECZ2D SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' ) USE ISO_C_BINDING USE precision_kind INTEGER(C_INT), value :: plan COMPLEX(dpk), device :: idata(:,:,:) REAL(dpk), device :: odata(:,:,:) END SUBROUTINE CUFFTEXECZ2D END INTERFACE CUFFTEXECZ2D INTERFACE CUFFTEXECD2Z SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' ) USE ISO_C_BINDING USE precision_kind INTEGER(C_INT), value :: plan REAL(dpk), device :: idata(:,:,:) COMPLEX(dpk), device :: odata(:,:,:) END SUBROUTINE CUFFTEXECD2Z END INTERFACE CUFFTEXECD2Z #endif END MODULE cuda_fft_interfaces