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

Last change on this file since 2000 was 2000, checked in by knoop, 9 years ago

Forced header and separation lines into 80 columns

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