kspaceFirstOrder3D-CUDA  1.1
The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CUDADeviceConstants.cuh
Go to the documentation of this file.
1 /**
2  * @file CUDADeviceConstants.cuh
3  *
4  * @author Jiri Jaros \n
5  * Faculty of Information Technology \n
6  * Brno University of Technology \n
7  * jarosjir@fit.vutbr.cz
8  *
9  * @brief The header file for the class for storing constants residing in CUDA constant memory.
10  *
11  * @version kspaceFirstOrder3D 3.4
12  *
13  * @date 17 February 2016, 10:53 (created) \n
14  * 25 July 2016, 12:55 (revised)
15  *
16  * @section License
17  * This file is part of the C++ extension of the k-Wave Toolbox
18  * (http://www.k-wave.org).\n Copyright (C) 2016 Jiri Jaros and Bradley Treeby.
19  *
20  * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify
21  * it under the terms of the GNU Lesser General Public License as published by the Free Software
22  * Foundation, either version 3 of the License, or (at your option) any later version.
23  *
24  * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
25  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
26  * General Public License for more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
29  * If not, see http://www.gnu.org/licenses/.
30  */
31 
32 
33 #ifndef CUDA_DEVICE_CONSTANTS_CUH
34 #define CUDA_DEVICE_CONSTANTS_CUH
35 
36 /**
37  * @struct TCUDADeviceConstants
38  * @brief Structure for CUDA parameters to be placed in constant memory. Only 32b values are used,
39  * since CUDA does not allow to allocate more than 2^32 elements and dim3 datatype
40  * is based on unsigned int.
41  */
43 {
44  /// Set constant memory
45  __host__ void SetUpCUDADeviceConstatns();
46 
47  /// size of X dimension.
48  unsigned int nx;
49  /// size of Y dimension.
50  unsigned int ny;
51  /// size of Z dimension.
52  unsigned int nz;
53  /// total number of elements.
54  unsigned int nElements;
55  /// 2D Slab size
56  unsigned int slabSize;
57  /// size of complex X dimension.
58  unsigned int nxComplex;
59  /// size of complex Y dimension.
60  unsigned int nyComplex;
61  /// size of complex Z dimension.
62  unsigned int nzComplex;
63  /// complex number of elements.
64  unsigned int nElementsComplex;
65  /// complex slab size.
66  unsigned int slabSizeComplex;
67  /// normalization constant for 3D FFT.
68  float fftDivider;
69  /// normalization constant for 1D FFT over X.
70  float fftDividerX;
71  /// normalization constant for 1D FFT over Y.
72  float fftDividerY;
73  /// normalization constant for 1D FFT over Z.
74  float fftDividerZ;
75 
76  /// dt
77  float dt;
78  /// 2.0 * dt
79  float dt2;
80  /// c^2
81  float c2;
82 
83  /// rho0 in homogeneous case
84  float rho0_scalar;
85  /// dt * rho0 in homogeneous case
87  /// dt / rho0_sgx in homogeneous case
89  /// dt / rho0_sgy in homogeneous case
91  /// dt / rho0_sgz in homogeneous case
93 
94  /// BonA value for homogeneous case
95  float BonA_scalar;
96 
97  /// Absorb_tau value for homogeneous case
99  /// Absorb_eta value for homogeneous case
101 
102  /// size of the u source index
103  unsigned int u_source_index_size;
104  /// u source mode
105  unsigned int u_source_mode;
106  /// u source many
107  unsigned int u_source_many;
108 
109  /// size of the p_source mask
110  unsigned int p_source_index_size;
111  /// p source mode
112  unsigned int p_source_mode;
113  /// p source many
114  unsigned int p_source_many;
115 
116 }; // end of TCUDAConstants
117 //--------------------------------------------------------------------------------------------------
118 
119 #endif /* CUDA_DEVICE_CONSTANTS_CUH */
120 
unsigned int u_source_index_size
size of the u source index
unsigned int nx
size of X dimension.
float fftDivider
normalization constant for 3D FFT.
float BonA_scalar
BonA value for homogeneous case.
Structure for CUDA parameters to be placed in constant memory. Only 32b values are used...
unsigned int slabSize
2D Slab size
unsigned int nxComplex
size of complex X dimension.
float rho0_sgx_scalar
dt / rho0_sgx in homogeneous case
unsigned int nzComplex
size of complex Z dimension.
unsigned int nz
size of Z dimension.
float fftDividerX
normalization constant for 1D FFT over X.
float rho0_scalar
rho0 in homogeneous case
unsigned int p_source_many
p source many
unsigned int u_source_mode
u source mode
unsigned int nElementsComplex
complex number of elements.
unsigned int p_source_index_size
size of the p_source mask
unsigned int slabSizeComplex
complex slab size.
float fftDividerY
normalization constant for 1D FFT over Y.
float rho0_sgy_scalar
dt / rho0_sgy in homogeneous case
unsigned int p_source_mode
p source mode
unsigned int u_source_many
u source many
unsigned int nyComplex
size of complex Y dimension.
unsigned int nElements
total number of elements.
unsigned int ny
size of Y dimension.
float rho0_sgz_scalar
dt / rho0_sgz in homogeneous case
float fftDividerZ
normalization constant for 1D FFT over Z.
float dt_rho0_scalar
dt * rho0 in homogeneous case
float absorb_tau_scalar
Absorb_tau value for homogeneous case.
float absorb_eta_scalar
Absorb_eta value for homogeneous case.
__host__ void SetUpCUDADeviceConstatns()
Set constant memory.