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

Last change on this file since 1166 was 1166, checked in by raasch, 8 years ago

small adjustment + bugfix for PGI 13.4 / CUDA 5.0

  • Property svn:keywords set to Id
File size: 3.5 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-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! C_DOUBLE/COMPLEX reset to dpk,
23! DEVICE attribut added to idata/odata arguments
24!
25! Former revisions:
26! -----------------
27! $Id: cuda_fft_interfaces.f90 1166 2013-05-24 13:55:44Z raasch $
28!
29! 1153 2013-05-10 14:33:08Z raasch
30! code adjustment of data types for CUDA fft required by PGI 12.3 / CUDA 5.0
31!
32! 1111 2013-03-08 23:54:10Z raasch
33! idata and odata changed from 1d- to 3d-arrays
34!
35! 1106 2013-03-04 05:31:38Z raasch
36! Initial revision
37!
38! Description:
39! ------------
40! FORTRAN interfaces for the CUDA fft
41! Routines for the fft along x and y (forward/backward) using the CUDA fft
42!--------------------------------------------------------------------------------!
43
44#if defined ( __cuda_fft )
45
46    INTEGER :: CUFFT_FORWARD = -1,  &
47               CUFFT_INVERSE =  1,  &
48               CUFFT_R2C = Z'2a',   &    ! Real to Complex (interleaved)
49               CUFFT_C2R = Z'2c',   &    ! Complex (interleaved) to Real
50               CUFFT_C2C = Z'29',   &    ! Complex to Complex, interleaved
51               CUFFT_D2Z = Z'6a',   &    ! Double to Double-Complex
52               CUFFT_Z2D = Z'6c',   &    ! Double-Complex to Double
53               CUFFT_Z2Z = Z'69'         ! Double-Complex to Double-Complex
54
55    PUBLIC
56
57
58!
59!-- cufftPlan1d( cufftHandle *plan, int nx, cufftType type, int batch )
60    INTERFACE CUFFTPLAN1D
61
62       SUBROUTINE CUFFTPLAN1D( plan, nx, type, batch ) bind( C, name='cufftPlan1d' )
63
64          USE ISO_C_BINDING
65
66          INTEGER(C_INT) ::  plan
67          INTEGER(C_INT), value ::  batch, nx, type
68
69       END SUBROUTINE CUFFTPLAN1D
70
71    END INTERFACE CUFFTPLAN1D
72
73!
74!-- cufftDestroy( cufftHandle plan )  !!! remove later if not really needed !!!
75    INTERFACE CUFFTDESTROY
76
77       SUBROUTINE CUFFTDESTROY( plan ) bind( C, name='cufftDestroy' )
78
79          USE ISO_C_BINDING
80
81          INTEGER(C_INT), VALUE ::  plan
82
83       END SUBROUTINE CUFFTDESTROY
84
85    END INTERFACE CUFFTDESTROY
86
87
88    INTERFACE CUFFTEXECZ2D
89
90       SUBROUTINE CUFFTEXECZ2D( plan, idata, odata ) bind( C, name='cufftExecZ2D' )
91
92          USE ISO_C_BINDING
93          USE precision_kind
94
95          INTEGER(C_INT), VALUE ::  plan
96          COMPLEX(dpk), DEVICE  ::  idata(:,:,:)
97          REAL(dpk), DEVICE     ::  odata(:,:,:)
98
99       END SUBROUTINE CUFFTEXECZ2D
100
101    END INTERFACE CUFFTEXECZ2D
102
103
104    INTERFACE CUFFTEXECD2Z
105
106       SUBROUTINE CUFFTEXECD2Z( plan, idata, odata ) bind( C, name='cufftExecD2Z' )
107
108          USE ISO_C_BINDING
109          USE precision_kind
110
111          INTEGER(C_INT), VALUE ::  plan
112          REAL(dpk), DEVICE     ::  idata(:,:,:)
113          COMPLEX(dpk), DEVICE  ::  odata(:,:,:)
114
115       END SUBROUTINE CUFFTEXECD2Z
116
117    END INTERFACE CUFFTEXECD2Z
118
119#endif
120 END MODULE cuda_fft_interfaces
Note: See TracBrowser for help on using the repository browser.