[1850] | 1 | !> @file cuda_fft_interfaces_mod.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1106] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1106] | 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 | ! |
---|
[1818] | 17 | ! Copyright 1997-2016 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1106] | 19 | ! |
---|
| 20 | ! Current revisions: |
---|
| 21 | ! ----------------- |
---|
[2000] | 22 | ! Forced header and separation lines into 80 columns |
---|
[1375] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: cuda_fft_interfaces_mod.f90 2000 2016-08-20 18:09:15Z knoop $ |
---|
| 27 | ! |
---|
[1851] | 28 | ! 1850 2016-04-08 13:29:27Z maronga |
---|
| 29 | ! Module renamed |
---|
| 30 | ! |
---|
| 31 | ! |
---|
[1683] | 32 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 33 | ! Code annotations made doxygen readable |
---|
| 34 | ! |
---|
[1375] | 35 | ! 1374 2014-04-25 12:55:07Z raasch |
---|
| 36 | ! bugfix: missing module kinds added |
---|
| 37 | ! |
---|
[1321] | 38 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
| 39 | ! Kind-parameters added to all INTEGER and REAL declaration statements, |
---|
[1320] | 40 | ! kinds are defined in new module kinds, |
---|
| 41 | ! old module precision_kind is removed, |
---|
| 42 | ! revision history before 2012 removed, |
---|
| 43 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 44 | ! all variable declaration statements |
---|
[1106] | 45 | ! |
---|
[1225] | 46 | ! 1224 2013-09-16 07:27:23Z raasch |
---|
| 47 | ! dummy interface added to avoid compiler warnings |
---|
| 48 | ! |
---|
[1167] | 49 | ! 1166 2013-05-24 13:55:44Z raasch |
---|
| 50 | ! C_DOUBLE/COMPLEX reset to dpk, |
---|
| 51 | ! DEVICE attribut added to idata/odata arguments |
---|
| 52 | ! |
---|
[1154] | 53 | ! 1153 2013-05-10 14:33:08Z raasch |
---|
| 54 | ! code adjustment of data types for CUDA fft required by PGI 12.3 / CUDA 5.0 |
---|
| 55 | ! |
---|
[1112] | 56 | ! 1111 2013-03-08 23:54:10Z raasch |
---|
| 57 | ! idata and odata changed from 1d- to 3d-arrays |
---|
| 58 | ! |
---|
[1107] | 59 | ! 1106 2013-03-04 05:31:38Z raasch |
---|
| 60 | ! Initial revision |
---|
[1106] | 61 | ! |
---|
| 62 | ! Description: |
---|
| 63 | ! ------------ |
---|
[1682] | 64 | !> FORTRAN interfaces for the CUDA fft |
---|
| 65 | !> Routines for the fft along x and y (forward/backward) using the CUDA fft |
---|
[1106] | 66 | !--------------------------------------------------------------------------------! |
---|
[1682] | 67 | MODULE cuda_fft_interfaces |
---|
| 68 | |
---|
[1106] | 69 | |
---|
| 70 | #if defined ( __cuda_fft ) |
---|
| 71 | |
---|
[1374] | 72 | USE kinds |
---|
| 73 | |
---|
[1682] | 74 | INTEGER(iwp) :: CUFFT_FORWARD = -1 !< |
---|
| 75 | INTEGER(iwp) :: CUFFT_INVERSE = 1 !< |
---|
| 76 | INTEGER(iwp) :: CUFFT_R2C = Z'2a' !< Real to Complex (interleaved) |
---|
| 77 | INTEGER(iwp) :: CUFFT_C2R = Z'2c' !< Complex (interleaved) to Real |
---|
| 78 | INTEGER(iwp) :: CUFFT_C2C = Z'29' !< Complex to Complex, interleaved |
---|
| 79 | INTEGER(iwp) :: CUFFT_D2Z = Z'6a' !< Double to Double-Complex |
---|
| 80 | INTEGER(iwp) :: CUFFT_Z2D = Z'6c' !< Double-Complex to Double |
---|
| 81 | INTEGER(iwp) :: CUFFT_Z2Z = Z'69' !< Double-Complex to Double-Complex |
---|
[1106] | 82 | |
---|
| 83 | PUBLIC |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | ! |
---|
| 87 | !-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch ) |
---|
| 88 | INTERFACE CUFFTPLAN1D |
---|
| 89 | |
---|
[1682] | 90 | !------------------------------------------------------------------------------! |
---|
| 91 | ! Description: |
---|
| 92 | ! ------------ |
---|
| 93 | !> @todo Missing subroutine description. |
---|
| 94 | !------------------------------------------------------------------------------! |
---|
[1106] | 95 | SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' ) |
---|
| 96 | |
---|
| 97 | USE ISO_C_BINDING |
---|
| 98 | |
---|
[1682] | 99 | INTEGER(C_INT) :: plan !< |
---|
| 100 | INTEGER(C_INT), value :: batch !< |
---|
| 101 | INTEGER(C_INT), value :: nx !< |
---|
| 102 | INTEGER(C_INT), value :: type !< |
---|
[1106] | 103 | END SUBROUTINE CUFFTPLAN1D |
---|
| 104 | |
---|
| 105 | END INTERFACE CUFFTPLAN1D |
---|
| 106 | |
---|
| 107 | ! |
---|
| 108 | !-- cufftDestroy( cufftHandle plan ) !!! remove later if not really needed !!! |
---|
| 109 | INTERFACE CUFFTDESTROY |
---|
| 110 | |
---|
[1682] | 111 | !------------------------------------------------------------------------------! |
---|
| 112 | ! Description: |
---|
| 113 | ! ------------ |
---|
| 114 | !> @todo Missing subroutine description. |
---|
| 115 | !------------------------------------------------------------------------------! |
---|
[1106] | 116 | SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' ) |
---|
| 117 | |
---|
| 118 | USE ISO_C_BINDING |
---|
| 119 | |
---|
[1166] | 120 | INTEGER(C_INT), VALUE :: plan |
---|
[1106] | 121 | |
---|
| 122 | END SUBROUTINE CUFFTDESTROY |
---|
| 123 | |
---|
| 124 | END INTERFACE CUFFTDESTROY |
---|
| 125 | |
---|
| 126 | |
---|
| 127 | INTERFACE CUFFTEXECZ2D |
---|
| 128 | |
---|
[1682] | 129 | !------------------------------------------------------------------------------! |
---|
| 130 | ! Description: |
---|
| 131 | ! ------------ |
---|
| 132 | !> @todo Missing subroutine description. |
---|
| 133 | !------------------------------------------------------------------------------! |
---|
[1106] | 134 | SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' ) |
---|
| 135 | |
---|
| 136 | USE ISO_C_BINDING |
---|
[1320] | 137 | USE kinds |
---|
[1106] | 138 | |
---|
[1682] | 139 | INTEGER(C_INT), VALUE :: plan !< |
---|
| 140 | COMPLEX(dp), DEVICE :: idata(:,:,:) !< |
---|
| 141 | REAL(dp), DEVICE :: odata(:,:,:) !< |
---|
[1106] | 142 | |
---|
| 143 | END SUBROUTINE CUFFTEXECZ2D |
---|
| 144 | |
---|
| 145 | END INTERFACE CUFFTEXECZ2D |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | INTERFACE CUFFTEXECD2Z |
---|
| 149 | |
---|
[1682] | 150 | !------------------------------------------------------------------------------! |
---|
| 151 | ! Description: |
---|
| 152 | ! ------------ |
---|
| 153 | !> @todo Missing subroutine description. |
---|
| 154 | !------------------------------------------------------------------------------! |
---|
[1106] | 155 | SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' ) |
---|
| 156 | |
---|
| 157 | USE ISO_C_BINDING |
---|
[1320] | 158 | |
---|
| 159 | USE kinds |
---|
[1106] | 160 | |
---|
[1682] | 161 | INTEGER(C_INT), VALUE :: plan !< |
---|
| 162 | REAL(dp), DEVICE :: idata(:,:,:) !< |
---|
| 163 | COMPLEX(dp), DEVICE :: odata(:,:,:) !< |
---|
[1106] | 164 | |
---|
| 165 | END SUBROUTINE CUFFTEXECD2Z |
---|
| 166 | |
---|
| 167 | END INTERFACE CUFFTEXECD2Z |
---|
| 168 | |
---|
[1224] | 169 | #else |
---|
| 170 | |
---|
| 171 | INTERFACE CUFFTdummy |
---|
| 172 | |
---|
[1682] | 173 | !------------------------------------------------------------------------------! |
---|
| 174 | ! Description: |
---|
| 175 | ! ------------ |
---|
| 176 | !> Dummy interface to avoid compiler warnings in case of no bublic objects |
---|
| 177 | !> declared. |
---|
| 178 | !------------------------------------------------------------------------------! |
---|
[1224] | 179 | SUBROUTINE CUFFTdummy( dummy ) |
---|
[1320] | 180 | |
---|
| 181 | USE kinds |
---|
[1224] | 182 | |
---|
[1682] | 183 | REAL(wp) :: dummy !< |
---|
[1224] | 184 | |
---|
| 185 | END SUBROUTINE CUFFTdummy |
---|
| 186 | |
---|
| 187 | END INTERFACE CUFFTdummy |
---|
| 188 | |
---|
[1106] | 189 | #endif |
---|
[1224] | 190 | |
---|
[1106] | 191 | END MODULE cuda_fft_interfaces |
---|