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.cu
Go to the documentation of this file.
1 /**
2  * @file CUDADeviceConstants.cu
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 implementation file for the class for storing constants residing in CUDA
10  * constant memory.
11  *
12  * @version kspaceFirstOrder3D 3.4
13  *
14  * @date 17 February 2016, 10:53 (created) \n
15  * 10 August 2016, 12:49 (revised)
16  *
17  * @section License
18  * This file is part of the C++ extension of the k-Wave Toolbox
19  * (http://www.k-wave.org).\n Copyright (C) 2016 Jiri Jaros and Bradley Treeby.
20  *
21  * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify
22  * it under the terms of the GNU Lesser General Public License as published by the Free Software
23  * Foundation, either version 3 of the License, or (at your option) any later version.
24  *
25  * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
26  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
27  * General Public License for more details.
28  *
29  * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
30  * If not, see http://www.gnu.org/licenses/.
31  */
32 
34 #include <Logger/Logger.h>
35 
36 
37 //------------------------------------------------------------------------------------------------//
38 //------------------------------------------ Constants -------------------------------------------//
39 //------------------------------------------------------------------------------------------------//
40 
41 
42 //------------------------------------------------------------------------------------------------//
43 //------------------------------------------ VARIABLES -------------------------------------------//
44 //------------------------------------------------------------------------------------------------//
45 
46 
47 
48 /**
49  * @var cudaDeviceConstants
50  * @brief This variable holds basic simulation constants for GPU.
51  * @details This variable holds necessary simulation constants in the CUDA GPU.
52  * memory. This variable is imported as extern into other CUDA units
53  */
55 
56 
57 
58 //------------------------------------------------------------------------------------------------//
59 //--------------------------------------- Public methods -----------------------------------------//
60 //------------------------------------------------------------------------------------------------//
61 
62 /**
63  * Copy the structure with simulation constants to the CUDA constant memory
64  */
66 {
67  checkCudaErrors(cudaMemcpyToSymbol(cudaDeviceConstants, this, sizeof(TCUDADeviceConstants)));
68 }// end of SetUpCUDADeviceConstatns
69 //--------------------------------------------------------------------------------------------------
__constant__ TCUDADeviceConstants cudaDeviceConstants
This variable holds basic simulation constants for GPU.
The header file for the class for storing constants residing in CUDA constant memory.
Structure for CUDA parameters to be placed in constant memory. Only 32b values are used...
#define checkCudaErrors(val)
Macro checking cuda errors and printing the file name and line. Inspired by CUDA common checking rout...
Definition: Logger.h:209
The header file containing a class responsible for printing out info and error messages (stdout...
__host__ void SetUpCUDADeviceConstatns()
Set constant memory.