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

Last change on this file since 1374 was 1374, checked in by raasch, 7 years ago

bugfixes:
missing variables added to ONLY lists in USE statements (advec_s_bc, advec_s_pw, advec_s_up, advec_ws, buoyancy, diffusion_e, diffusion_s, fft_xy, flow_statistics, palm, prognostic_equations)
missing module kinds added (cuda_fft_interfaces)
dpk renamed dp (fft_xy)
missing dependency for check_open added (Makefile)
variables removed from acc-present-list (diffusion_e, diffusion_w, diffusivities, production_e, wall_fluxes)
syntax errors removed from openacc-branch (flow_statistics)
USE-statement for nopointer-case added (swap_timelevel)

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