[1106] | 1 | MODULE cuda_fft_interfaces |
---|
| 2 | |
---|
| 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
| 17 | ! Copyright 1997-2012 Leibniz University Hannover |
---|
| 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
| 20 | ! Current revisions: |
---|
| 21 | ! ----------------- |
---|
[1112] | 22 | ! |
---|
[1106] | 23 | ! |
---|
| 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: cuda_fft_interfaces.f90 1112 2013-03-09 00:34:37Z raasch $ |
---|
| 27 | ! |
---|
[1112] | 28 | ! 1111 2013-03-08 23:54:10Z raasch |
---|
| 29 | ! idata and odata changed from 1d- to 3d-arrays |
---|
| 30 | ! |
---|
[1107] | 31 | ! 1106 2013-03-04 05:31:38Z raasch |
---|
| 32 | ! Initial revision |
---|
[1106] | 33 | ! |
---|
| 34 | ! Description: |
---|
| 35 | ! ------------ |
---|
| 36 | ! FORTRAN interfaces for the CUDA fft |
---|
| 37 | ! Routines for the fft along x and y (forward/backward) using the CUDA fft |
---|
| 38 | !--------------------------------------------------------------------------------! |
---|
| 39 | |
---|
| 40 | #if defined ( __cuda_fft ) |
---|
| 41 | |
---|
| 42 | INTEGER :: CUFFT_FORWARD = -1, & |
---|
| 43 | CUFFT_INVERSE = 1, & |
---|
| 44 | CUFFT_R2C = Z'2a', & ! Real to Complex (interleaved) |
---|
| 45 | CUFFT_C2R = Z'2c', & ! Complex (interleaved) to Real |
---|
| 46 | CUFFT_C2C = Z'29', & ! Complex to Complex, interleaved |
---|
| 47 | CUFFT_D2Z = Z'6a', & ! Double to Double-Complex |
---|
| 48 | CUFFT_Z2D = Z'6c', & ! Double-Complex to Double |
---|
| 49 | CUFFT_Z2Z = Z'69' ! Double-Complex to Double-Complex |
---|
| 50 | |
---|
| 51 | PUBLIC |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | ! |
---|
| 55 | !-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch ) |
---|
| 56 | INTERFACE CUFFTPLAN1D |
---|
| 57 | |
---|
| 58 | SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' ) |
---|
| 59 | |
---|
| 60 | USE ISO_C_BINDING |
---|
| 61 | |
---|
| 62 | INTEGER(C_INT) :: plan |
---|
| 63 | INTEGER(C_INT), value :: batch, nx, type |
---|
| 64 | |
---|
| 65 | END SUBROUTINE CUFFTPLAN1D |
---|
| 66 | |
---|
| 67 | END INTERFACE CUFFTPLAN1D |
---|
| 68 | |
---|
| 69 | ! |
---|
| 70 | !-- cufftDestroy( cufftHandle plan ) !!! remove later if not really needed !!! |
---|
| 71 | INTERFACE CUFFTDESTROY |
---|
| 72 | |
---|
| 73 | SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' ) |
---|
| 74 | |
---|
| 75 | USE ISO_C_BINDING |
---|
| 76 | |
---|
| 77 | INTEGER(C_INT), value :: plan |
---|
| 78 | |
---|
| 79 | END SUBROUTINE CUFFTDESTROY |
---|
| 80 | |
---|
| 81 | END INTERFACE CUFFTDESTROY |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | INTERFACE CUFFTEXECZ2D |
---|
| 85 | |
---|
| 86 | SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' ) |
---|
| 87 | |
---|
| 88 | USE ISO_C_BINDING |
---|
| 89 | USE precision_kind |
---|
| 90 | |
---|
| 91 | INTEGER(C_INT), value :: plan |
---|
[1111] | 92 | COMPLEX(dpk), device :: idata(:,:,:) |
---|
| 93 | REAL(dpk), device :: odata(:,:,:) |
---|
[1106] | 94 | |
---|
| 95 | END SUBROUTINE CUFFTEXECZ2D |
---|
| 96 | |
---|
| 97 | END INTERFACE CUFFTEXECZ2D |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | INTERFACE CUFFTEXECD2Z |
---|
| 101 | |
---|
| 102 | SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' ) |
---|
| 103 | |
---|
| 104 | USE ISO_C_BINDING |
---|
| 105 | USE precision_kind |
---|
| 106 | |
---|
| 107 | INTEGER(C_INT), value :: plan |
---|
[1111] | 108 | REAL(dpk), device :: idata(:,:,:) |
---|
| 109 | COMPLEX(dpk), device :: odata(:,:,:) |
---|
[1106] | 110 | |
---|
| 111 | END SUBROUTINE CUFFTEXECD2Z |
---|
| 112 | |
---|
| 113 | END INTERFACE CUFFTEXECD2Z |
---|
| 114 | |
---|
| 115 | #endif |
---|
| 116 | END MODULE cuda_fft_interfaces |
---|