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
OutputStreamsCUDAKernels.cuh
Go to the documentation of this file.
1 /**
2  * @file OutputStreamsCUDAKernels.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 of cuda kernels used for data sampling (output streams).
10  *
11  * @version kspaceFirstOrder3D 3.4
12  *
13  * @date 27 January 2015, 16:25 (created) \n
14  * 29 July 2016, 14:19 (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 OUTPUT_STREAMS_CUDA_KERNELS_CUH
34 #define OUTPUT_STREAMS_CUDA_KERNELS_CUH
35 
36 #include <cuda.h>
37 #include <cuda_runtime.h>
38 
40 
41 /**
42  * @namespace OutputStreamsCUDAKernels
43  * @brief List of cuda kernels used for sampling data.
44  * @details List of cuda kernels used for sampling data.
45  *
46  */
47 namespace OutputStreamsCUDAKernels
48 {
49  /// Kernel to sample quantities using an index sensor mask
50  template<TBaseOutputHDF5Stream::TReduceOperator reduceOp>
51  void SampleIndex(float* samplingBuffer,
52  const float* sourceData,
53  const size_t* sensorData,
54  const size_t nSamples);
55 
56  /// Kernel to sample quantities inside one cuboid
57  template<TBaseOutputHDF5Stream::TReduceOperator reduceOp>
58  void SampleCuboid(float* samplingBuffer,
59  const float* sourceData,
60  const dim3 topLeftCorner,
61  const dim3 bottomRightCorner,
62  const dim3 matrixSize,
63  const size_t nSamples);
64 
65  /// Kernel to sample of the quantity on the whole domain
66  template<TBaseOutputHDF5Stream::TReduceOperator reduceOp>
67  void SampleAll(float* samplingBuffer,
68  const float* sourceData,
69  const size_t nSamples);
70 
71  /// Kernel to calculate post-processing for RMS
72  void PostProcessingRMS(float* samplingBuffer,
73  const float scalingCoeff,
74  const size_t nSamples);
75 }// end of OutputStreamsCUDAKernels
76 //--------------------------------------------------------------------------------------------------
77 
78 #endif /* OUTPUT_STREAMS_CUDA_KERNELS_H */
79 
The header file of the class saving RealMatrix data into the output HDF5 file.
void SampleIndex(float *samplingBuffer, const float *sourceData, const size_t *sensorData, const size_t nSamples)
Kernel to sample quantities using an index sensor mask.
void PostProcessingRMS(float *samplingBuffer, const float scalingCoeff, const size_t nSamples)
Kernel to calculate post-processing for RMS.
void SampleCuboid(float *samplingBuffer, const float *sourceData, const dim3 topLeftCorner, const dim3 bottomRightCorner, const dim3 matrixSize, const size_t nSamples)
Kernel to sample quantities inside one cuboid.
void SampleAll(float *samplingBuffer, const float *sourceData, const size_t nSamples)
Kernel to sample of the quantity on the whole domain.