| kspaceFirstOrder3D-CUDA 1.1 The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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 */
42 struct TCUDADeviceConstants
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
86 float dt_rho0_scalar;
87 /// dt / rho0_sgx in homogeneous case
88 float rho0_sgx_scalar;
89 /// dt / rho0_sgy in homogeneous case
90 float rho0_sgy_scalar;
91 /// dt / rho0_sgz in homogeneous case
92 float rho0_sgz_scalar;
93
94 /// BonA value for homogeneous case
95 float BonA_scalar;
96
97 /// Absorb_tau value for homogeneous case
98 float absorb_tau_scalar;
99 /// Absorb_eta value for homogeneous case
100 float absorb_eta_scalar;
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
TCUDADeviceConstants::u_source_index_size
unsigned int u_source_index_size
size of the u source index
Definition: CUDADeviceConstants.cuh:103
TCUDADeviceConstants::nx
unsigned int nx
size of X dimension.
Definition: CUDADeviceConstants.cuh:48
TCUDADeviceConstants::fftDivider
float fftDivider
normalization constant for 3D FFT.
Definition: CUDADeviceConstants.cuh:68
TCUDADeviceConstants::BonA_scalar
float BonA_scalar
BonA value for homogeneous case.
Definition: CUDADeviceConstants.cuh:95
TCUDADeviceConstants
Structure for CUDA parameters to be placed in constant memory. Only 32b values are used...
Definition: CUDADeviceConstants.cuh:42
TCUDADeviceConstants::slabSize
unsigned int slabSize
2D Slab size
Definition: CUDADeviceConstants.cuh:56
TCUDADeviceConstants::nxComplex
unsigned int nxComplex
size of complex X dimension.
Definition: CUDADeviceConstants.cuh:58
TCUDADeviceConstants::dt
float dt
dt
Definition: CUDADeviceConstants.cuh:77
TCUDADeviceConstants::rho0_sgx_scalar
float rho0_sgx_scalar
dt / rho0_sgx in homogeneous case
Definition: CUDADeviceConstants.cuh:88
TCUDADeviceConstants::nzComplex
unsigned int nzComplex
size of complex Z dimension.
Definition: CUDADeviceConstants.cuh:62
TCUDADeviceConstants::nz
unsigned int nz
size of Z dimension.
Definition: CUDADeviceConstants.cuh:52
TCUDADeviceConstants::fftDividerX
float fftDividerX
normalization constant for 1D FFT over X.
Definition: CUDADeviceConstants.cuh:70
TCUDADeviceConstants::rho0_scalar
float rho0_scalar
rho0 in homogeneous case
Definition: CUDADeviceConstants.cuh:84
TCUDADeviceConstants::p_source_many
unsigned int p_source_many
p source many
Definition: CUDADeviceConstants.cuh:114
TCUDADeviceConstants::u_source_mode
unsigned int u_source_mode
u source mode
Definition: CUDADeviceConstants.cuh:105
TCUDADeviceConstants::nElementsComplex
unsigned int nElementsComplex
complex number of elements.
Definition: CUDADeviceConstants.cuh:64
TCUDADeviceConstants::p_source_index_size
unsigned int p_source_index_size
size of the p_source mask
Definition: CUDADeviceConstants.cuh:110
TCUDADeviceConstants::slabSizeComplex
unsigned int slabSizeComplex
complex slab size.
Definition: CUDADeviceConstants.cuh:66
TCUDADeviceConstants::fftDividerY
float fftDividerY
normalization constant for 1D FFT over Y.
Definition: CUDADeviceConstants.cuh:72
TCUDADeviceConstants::rho0_sgy_scalar
float rho0_sgy_scalar
dt / rho0_sgy in homogeneous case
Definition: CUDADeviceConstants.cuh:90
TCUDADeviceConstants::p_source_mode
unsigned int p_source_mode
p source mode
Definition: CUDADeviceConstants.cuh:112
TCUDADeviceConstants::u_source_many
unsigned int u_source_many
u source many
Definition: CUDADeviceConstants.cuh:107
TCUDADeviceConstants::nyComplex
unsigned int nyComplex
size of complex Y dimension.
Definition: CUDADeviceConstants.cuh:60
TCUDADeviceConstants::nElements
unsigned int nElements
total number of elements.
Definition: CUDADeviceConstants.cuh:54
TCUDADeviceConstants::dt2
float dt2
2.0 * dt
Definition: CUDADeviceConstants.cuh:79
TCUDADeviceConstants::ny
unsigned int ny
size of Y dimension.
Definition: CUDADeviceConstants.cuh:50
TCUDADeviceConstants::rho0_sgz_scalar
float rho0_sgz_scalar
dt / rho0_sgz in homogeneous case
Definition: CUDADeviceConstants.cuh:92
TCUDADeviceConstants::fftDividerZ
float fftDividerZ
normalization constant for 1D FFT over Z.
Definition: CUDADeviceConstants.cuh:74
TCUDADeviceConstants::c2
float c2
c^2
Definition: CUDADeviceConstants.cuh:81
TCUDADeviceConstants::dt_rho0_scalar
float dt_rho0_scalar
dt * rho0 in homogeneous case
Definition: CUDADeviceConstants.cuh:86
TCUDADeviceConstants::absorb_tau_scalar
float absorb_tau_scalar
Absorb_tau value for homogeneous case.
Definition: CUDADeviceConstants.cuh:98
TCUDADeviceConstants::absorb_eta_scalar
float absorb_eta_scalar
Absorb_eta value for homogeneous case.
Definition: CUDADeviceConstants.cuh:100
TCUDADeviceConstants::SetUpCUDADeviceConstatns
__host__ void SetUpCUDADeviceConstatns()
Set constant memory.
Definition: CUDADeviceConstants.cu:65