OpenMPCD
DeviceCode/Symbols.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Declares some central CUDA constant symbols.
4  */
5 
6 #ifndef OPENMPCD_CUDA_DEVICECODE_SYMBOLS_HPP
7 #define OPENMPCD_CUDA_DEVICECODE_SYMBOLS_HPP
8 
9 #include <OpenMPCD/Types.hpp>
10 
11 namespace OpenMPCD
12 {
13 namespace CUDA
14 {
15 namespace DeviceCode
16 {
17 
18 extern __constant__ unsigned int mpcSimulationBoxSizeX;
19  ///< The size of the primary simulation box along the `x` direction.
20 extern __constant__ unsigned int mpcSimulationBoxSizeY;
21  ///< The size of the primary simulation box along the `y` direction.
22 extern __constant__ unsigned int mpcSimulationBoxSizeZ;
23  ///< The size of the primary simulation box along the `z` direction.
24 
25 extern __constant__ unsigned int collisionCellCount;
26  ///< The number of collision cells in the system.
27 
28 extern __constant__ FP streamingTimestep;
29  ///< The MPC streaming time-step.
30 
31 extern __constant__ FP srdCollisionAngle;
32  ///< The collision angle for SRD collisions.
33 
34 
35 /**
36  * Sets the symbols `mpcSimulationBoxSizeX`, `mpcSimulationBoxSizeY`,
37  * `mpcSimulationBoxSizeZ`, and `collisionCellCount` in
38  * `OpenMPCD::CUDA::DeviceCode`.
39  *
40  * `collisionCellCount` will be set to the product of the three arguments
41  * supplied.
42  *
43  * @throw OpenMPCD::InvalidArgumentException
44  * If `OPENMPCD_DEBUG` is defined, throws if either argument is `0`.
45  *
46  * @param[in] simBoxSizeX The value for `mpcSimulationBoxSizeX`.
47  * @param[in] simBoxSizeY The value for `mpcSimulationBoxSizeY`.
48  * @param[in] simBoxSizeZ The value for `mpcSimulationBoxSizeZ`.
49  */
51  const unsigned int simBoxSizeX,
52  const unsigned int simBoxSizeY,
53  const unsigned int simBoxSizeZ);
54 
55 /**
56  * Sets the symbol `OpenMPCD::CUDA::DeviceCode::streamingTimestep`.
57  *
58  * @throw OpenMPCD::InvalidArgumentException
59  * If `OPENMPCD_DEBUG` is defined, throws if `timestep == 0`.
60  *
61  * @param[in] timestep The streaming timestep for each MPC fluid streaming step.
62  */
63 void setMPCStreamingTimestep(const FP timestep);
64 
65 /**
66  * Sets the symbol `OpenMPCD::CUDA::DeviceCode::srdCollisionAngle`.
67  *
68  * @param[in] angle The SRD collision angle.
69  */
70 void setSRDCollisionAngleSymbol(const FP angle);
71 
72 } //namespace DeviceCode
73 } //namespace CUDA
74 } //namespace OpenMPCD
75 
76 #endif
OpenMPCD::CUDA::DeviceCode::setSimulationBoxSizeSymbols
void setSimulationBoxSizeSymbols(const unsigned int simBoxSizeX, const unsigned int simBoxSizeY, const unsigned int simBoxSizeZ)
Sets the symbols mpcSimulationBoxSizeX, mpcSimulationBoxSizeY, mpcSimulationBoxSizeZ,...
OpenMPCD::CUDA::DeviceCode::mpcSimulationBoxSizeY
__constant__ unsigned int mpcSimulationBoxSizeY
The size of the primary simulation box along the y direction.
OpenMPCD::CUDA::DeviceCode::srdCollisionAngle
__constant__ FP srdCollisionAngle
The collision angle for SRD collisions.
OpenMPCD::CUDA::DeviceCode::streamingTimestep
__constant__ FP streamingTimestep
The MPC streaming time-step.
OpenMPCD::CUDA::DeviceCode::mpcSimulationBoxSizeX
__constant__ unsigned int mpcSimulationBoxSizeX
The size of the primary simulation box along the x direction.
OpenMPCD::CUDA::DeviceCode::setSRDCollisionAngleSymbol
void setSRDCollisionAngleSymbol(const FP angle)
Sets the symbol OpenMPCD::CUDA::DeviceCode::srdCollisionAngle.
OpenMPCD::CUDA::DeviceCode::mpcSimulationBoxSizeZ
__constant__ unsigned int mpcSimulationBoxSizeZ
The size of the primary simulation box along the z direction.
OpenMPCD::CUDA::DeviceCode::collisionCellCount
__constant__ unsigned int collisionCellCount
The number of collision cells in the system.
OpenMPCD::CUDA::DeviceCode::setMPCStreamingTimestep
void setMPCStreamingTimestep(const FP timestep)
Sets the symbol OpenMPCD::CUDA::DeviceCode::streamingTimestep.
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
Types.hpp