source: palm/trunk/SOURCE/cuda_fft_interfaces_mod.f90 @ 1850

Last change on this file since 1850 was 1850, checked in by maronga, 8 years ago

added _mod string to several filenames to meet the naming convection for modules

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