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

Last change on this file since 1850 was 1850, checked in by maronga, 6 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
Line 
1!> @file cuda_fft_interfaces_mod.f90
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!
16! Copyright 1997-2016 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21! Module renamed
22!
23!
24! Former revisions:
25! -----------------
26! $Id: cuda_fft_interfaces_mod.f90 1850 2016-04-08 13:29:27Z maronga $
27!
28! 1682 2015-10-07 23:56:08Z knoop
29! Code annotations made doxygen readable
30!
31! 1374 2014-04-25 12:55:07Z raasch
32! bugfix: missing module kinds added
33!
34! 1320 2014-03-20 08:40:49Z raasch
35! Kind-parameters added to all INTEGER and REAL declaration statements,
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
41!
42! 1224 2013-09-16 07:27:23Z raasch
43! dummy interface added to avoid compiler warnings
44!
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!
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!
52! 1111 2013-03-08 23:54:10Z raasch
53! idata and odata changed from 1d- to 3d-arrays
54!
55! 1106 2013-03-04 05:31:38Z raasch
56! Initial revision
57!
58! Description:
59! ------------
60!> FORTRAN interfaces for the CUDA fft
61!> Routines for the fft along x and y (forward/backward) using the CUDA fft
62!--------------------------------------------------------------------------------!
63 MODULE cuda_fft_interfaces
64 
65
66#if defined ( __cuda_fft )
67
68    USE kinds
69
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
78
79    PUBLIC
80
81
82!
83!-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch )
84    INTERFACE CUFFTPLAN1D
85
86!------------------------------------------------------------------------------!
87! Description:
88! ------------
89!> @todo Missing subroutine description.
90!------------------------------------------------------------------------------!
91       SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' )
92
93          USE ISO_C_BINDING
94
95          INTEGER(C_INT)        ::  plan   !<
96          INTEGER(C_INT), value ::  batch  !<
97          INTEGER(C_INT), value ::  nx     !<
98          INTEGER(C_INT), value ::  type   !<
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
107!------------------------------------------------------------------------------!
108! Description:
109! ------------
110!> @todo Missing subroutine description.
111!------------------------------------------------------------------------------!
112       SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' )
113
114          USE ISO_C_BINDING
115
116          INTEGER(C_INT), VALUE ::  plan
117
118       END SUBROUTINE CUFFTDESTROY
119
120    END INTERFACE CUFFTDESTROY
121
122
123    INTERFACE CUFFTEXECZ2D
124
125!------------------------------------------------------------------------------!
126! Description:
127! ------------
128!> @todo Missing subroutine description.
129!------------------------------------------------------------------------------!
130       SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' )
131
132          USE ISO_C_BINDING
133          USE kinds
134
135          INTEGER(C_INT), VALUE ::  plan          !<
136          COMPLEX(dp), DEVICE   ::  idata(:,:,:)  !<
137          REAL(dp), DEVICE      ::  odata(:,:,:)  !<
138
139       END SUBROUTINE CUFFTEXECZ2D
140
141    END INTERFACE CUFFTEXECZ2D
142
143
144    INTERFACE CUFFTEXECD2Z
145
146!------------------------------------------------------------------------------!
147! Description:
148! ------------
149!> @todo Missing subroutine description.
150!------------------------------------------------------------------------------!
151       SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' )
152
153          USE ISO_C_BINDING
154         
155          USE kinds
156
157          INTEGER(C_INT), VALUE ::  plan          !<
158          REAL(dp), DEVICE      ::  idata(:,:,:)  !<
159          COMPLEX(dp), DEVICE   ::  odata(:,:,:)  !<
160
161       END SUBROUTINE CUFFTEXECD2Z
162
163    END INTERFACE CUFFTEXECD2Z
164
165#else
166
167    INTERFACE CUFFTdummy
168
169!------------------------------------------------------------------------------!
170! Description:
171! ------------
172!> Dummy interface to avoid compiler warnings in case of no bublic objects
173!> declared.
174!------------------------------------------------------------------------------!
175       SUBROUTINE CUFFTdummy( dummy )
176       
177          USE kinds
178
179          REAL(wp) ::  dummy  !<
180
181       END SUBROUTINE CUFFTdummy
182
183    END INTERFACE CUFFTdummy
184
185#endif
186
187 END MODULE cuda_fft_interfaces
Note: See TracBrowser for help on using the repository browser.