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

Last change on this file since 1153 was 1153, checked in by raasch, 11 years ago

code adjustment of accelerator version for PGI 12.3 / CUDA 5.0

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