source: palm/trunk/SOURCE/cuda_fft_interfaces.f90 @ 1320

Last change on this file since 1320 was 1320, checked in by raasch, 10 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
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-2014 Leibniz Universitaet Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! ONLY-attribute added to USE-statements,
23! kind-parameters added to all INTEGER and REAL declaration statements,
24! kinds are defined in new module kinds,
25! old module precision_kind is removed,
26! revision history before 2012 removed,
27! comment fields (!:) to be used for variable explanations added to
28! all variable declaration statements
29!
30! Former revisions:
31! -----------------
32! $Id: cuda_fft_interfaces.f90 1320 2014-03-20 08:40:49Z raasch $
33!
34! 1224 2013-09-16 07:27:23Z raasch
35! dummy interface added to avoid compiler warnings
36!
37! 1166 2013-05-24 13:55:44Z raasch
38! C_DOUBLE/COMPLEX reset to dpk,
39! DEVICE attribut added to idata/odata arguments
40!
41! 1153 2013-05-10 14:33:08Z raasch
42! code adjustment of data types for CUDA fft required by PGI 12.3 / CUDA 5.0
43!
44! 1111 2013-03-08 23:54:10Z raasch
45! idata and odata changed from 1d- to 3d-arrays
46!
47! 1106 2013-03-04 05:31:38Z raasch
48! Initial revision
49!
50! Description:
51! ------------
52! FORTRAN interfaces for the CUDA fft
53! Routines for the fft along x and y (forward/backward) using the CUDA fft
54!--------------------------------------------------------------------------------!
55
56#if defined ( __cuda_fft )
57
58    INTEGER(iwp) ::  CUFFT_FORWARD = -1   !:
59    INTEGER(iwp) ::  CUFFT_INVERSE =  1   !:
60    INTEGER(iwp) ::  CUFFT_R2C = Z'2a'    !: Real to Complex (interleaved)
61    INTEGER(iwp) ::  CUFFT_C2R = Z'2c'    !: Complex (interleaved) to Real
62    INTEGER(iwp) ::  CUFFT_C2C = Z'29'    !: Complex to Complex, interleaved
63    INTEGER(iwp) ::  CUFFT_D2Z = Z'6a'    !: Double to Double-Complex
64    INTEGER(iwp) ::  CUFFT_Z2D = Z'6c'    !: Double-Complex to Double
65    INTEGER(iwp) ::  CUFFT_Z2Z = Z'69'    !: Double-Complex to Double-Complex
66
67    PUBLIC
68
69
70!
71!-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch )
72    INTERFACE CUFFTPLAN1D
73
74       SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' )
75
76          USE ISO_C_BINDING
77
78          INTEGER(C_INT)        ::  plan   !:
79          INTEGER(C_INT), value ::  batch  !:
80          INTEGER(C_INT), value ::  nx     !:
81          INTEGER(C_INT), value ::  type   !:
82       END SUBROUTINE CUFFTPLAN1D
83
84    END INTERFACE CUFFTPLAN1D
85
86!
87!-- cufftDestroy( cufftHandle plan )  !!! remove later if not really needed !!!
88    INTERFACE CUFFTDESTROY
89
90       SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' )
91
92          USE ISO_C_BINDING
93
94          INTEGER(C_INT), VALUE ::  plan
95
96       END SUBROUTINE CUFFTDESTROY
97
98    END INTERFACE CUFFTDESTROY
99
100
101    INTERFACE CUFFTEXECZ2D
102
103       SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' )
104
105          USE ISO_C_BINDING
106          USE kinds
107
108          INTEGER(C_INT), VALUE ::  plan          !:
109          COMPLEX(dp), DEVICE   ::  idata(:,:,:)  !:
110          REAL(dp), DEVICE      ::  odata(:,:,:)  !:
111
112       END SUBROUTINE CUFFTEXECZ2D
113
114    END INTERFACE CUFFTEXECZ2D
115
116
117    INTERFACE CUFFTEXECD2Z
118
119       SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' )
120
121          USE ISO_C_BINDING
122         
123          USE kinds
124
125          INTEGER(C_INT), VALUE ::  plan          !:
126          REAL(dp), DEVICE      ::  idata(:,:,:)  !:
127          COMPLEX(dp), DEVICE   ::  odata(:,:,:)  !:
128
129       END SUBROUTINE CUFFTEXECD2Z
130
131    END INTERFACE CUFFTEXECD2Z
132
133#else
134
135!
136!-- Dummy interface to avoid compiler warnings in case of no bublic objects
137!-- declared
138    INTERFACE CUFFTdummy
139
140       SUBROUTINE CUFFTdummy( dummy )
141       
142          USE kinds
143
144          REAL(wp) ::  dummy  !:
145
146       END SUBROUTINE CUFFTdummy
147
148    END INTERFACE CUFFTdummy
149
150#endif
151
152 END MODULE cuda_fft_interfaces
Note: See TracBrowser for help on using the repository browser.