![]() |
kspaceFirstOrder3D-CUDA
1.1
The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mask to get the address of sampled voxels. More...
#include <IndexMatrix.h>
Public Member Functions | |
TIndexMatrix (const TDimensionSizes &dimensionSizes) | |
Constructor allocating memory. More... | |
virtual | ~TIndexMatrix () |
Destructor. More... | |
virtual void | ReadDataFromHDF5File (THDF5_File &file, TMatrixName &matrixName) |
Read data from the HDF5 file. More... | |
virtual void | WriteDataToHDF5File (THDF5_File &file, TMatrixName &matrixName, const size_t compressionLevel) |
Write data into the HDF5 file. More... | |
size_t & | operator[] (const size_t &index) |
Operator []. More... | |
const size_t & | operator[] (const size_t &index) const |
Operator [], constant version. More... | |
TDimensionSizes | GetTopLeftCorner (const size_t &index) const |
Get the top left corner of the index-th cuboid. More... | |
TDimensionSizes | GetBottomRightCorner (const size_t &index) const |
Get the bottom right corner of the index-th cuboid. More... | |
void | RecomputeIndicesToCPP () |
Recompute indices MATALAB->C++. More... | |
void | RecomputeIndicesToMatlab () |
Recompute indices C++ -> MATLAB. More... | |
size_t | GetTotalNumberOfElementsInAllCuboids () const |
Get the total number of elements to be sampled within all cuboids. More... | |
![]() | |
TBaseIndexMatrix () | |
Default constructor. More... | |
virtual | ~TBaseIndexMatrix () |
Destructor. | |
virtual struct TDimensionSizes | GetDimensionSizes () const |
Get dimension sizes of the matrix. | |
virtual size_t | GetElementCount () const |
Get total element count of the matrix. | |
virtual size_t | GetAllocatedElementCount () const |
Get total allocated element count (might differ from total element count used for the simulation because of padding). | |
virtual void | ZeroMatrix () |
Zero all elements of the matrix (NUMA first touch). More... | |
virtual size_t * | GetHostData () |
Get raw data out of the class (for direct CPU kernel access). | |
virtual const size_t * | GetHostData () const |
Get raw data out of the class (for direct CPU kernel access). | |
virtual size_t * | GetDeviceData () |
Get raw GPU data out of the class (for direct GPU kernel access). | |
virtual const size_t * | GetDeviceData () const |
Get raw GPU data out of the class (for direct GPU kernel access). | |
virtual void | CopyToDevice () |
Copy data from CPU -> GPU (Host -> Device). More... | |
virtual void | CopyFromDevice () |
Copy data from GPU -> CPU (Device -> Host). More... | |
![]() | |
TBaseMatrix () | |
Default constructor. | |
virtual | ~TBaseMatrix () |
Destructor. | |
Protected Member Functions | |
TIndexMatrix () | |
Default constructor not allowed for public. | |
TIndexMatrix (const TIndexMatrix &src) | |
Copy constructor not allowed for public. | |
TIndexMatrix & | operator= (const TIndexMatrix &src) |
Operator = not allowed for public. | |
![]() | |
virtual void | AllocateMemory () |
Memory allocation (both on CPU and GPU) More... | |
virtual void | FreeMemory () |
Memory deallocation (both on CPU and GPU) More... | |
TBaseIndexMatrix (const TBaseIndexMatrix &src) | |
Copy constructor is not allowed for public. | |
TBaseIndexMatrix & | operator= (const TBaseIndexMatrix &src) |
operator = is not allowed for public | |
Static Private Attributes | |
static const size_t | CHUNK_SIZE_1D_4MB = 1048576 |
Number of elements to get 4MB block of data. | |
static const size_t | CHUNK_SIZE_1D_1MB = 262144 |
Number of elements to get 1MB block of data. | |
static const size_t | CHUNK_SIZE_1D_256KB = 65536 |
Number of elements to get 256KB block of data. | |
Additional Inherited Members | |
![]() | |
size_t | nElements |
Total number of elements. | |
size_t | nAllocatedElements |
Total number of allocated elements (the array size). | |
struct TDimensionSizes | dimensionSizes |
Dimension sizes. | |
size_t | rowSize |
Size of 1D row in X dimension. | |
size_t | slabSize |
Size of 2D slab (X,Y). | |
size_t * | hostData |
Raw CPU matrix data. | |
size_t * | deviceData |
Raw GPU matrix data. | |
The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mask to get the address of sampled voxels. Stores data both GPU and CPU side.
Definition at line 46 of file IndexMatrix.h.
TIndexMatrix::TIndexMatrix | ( | const TDimensionSizes & | dimensionSizes | ) |
Constructor allocating memory.
[in] | dimensionSizes | - Dimension sizes |
Definition at line 48 of file IndexMatrix.cpp.
|
virtual |
Destructor.
Definition at line 67 of file IndexMatrix.cpp.
TDimensionSizes TIndexMatrix::GetBottomRightCorner | ( | const size_t & | index | ) | const |
Get the top bottom right of the index-th cuboid. Cuboids are stored as 6-tuples (two 3D coordinates). This gives the first three coordinates. This routine works only on the CPU side.
[in] | index | -Index of the cuboid |
Definition at line 175 of file IndexMatrix.cpp.
TDimensionSizes TIndexMatrix::GetTopLeftCorner | ( | const size_t & | index | ) | const |
Get the top left corner of the index-th cuboid. Cuboids are stored as 6-tuples (two 3D coordinates). This gives the first three coordinates.
[in] | index | - Index of the cuboid |
Definition at line 158 of file IndexMatrix.cpp.
size_t TIndexMatrix::GetTotalNumberOfElementsInAllCuboids | ( | ) | const |
Get total number of elements in all cuboids to be able to allocate output file.
Definition at line 217 of file IndexMatrix.cpp.
|
inline |
Operator [].
[in] | index | - 1D index into the matrix |
Definition at line 69 of file IndexMatrix.h.
|
inline |
Operator [], constant version
[in] | index | - 1D index into the matrix |
Definition at line 80 of file IndexMatrix.h.
|
virtual |
Read data from HDF5 file (only from the root group).
[in] | file | - HDF5 file handle |
[in] | matrixName | - HDF5 dataset name |
ios:failure | if error occurs. |
Implements TBaseMatrix.
Definition at line 81 of file IndexMatrix.cpp.
void TIndexMatrix::RecomputeIndicesToCPP | ( | ) |
Recompute indeces, MATLAB -> C++.
Definition at line 189 of file IndexMatrix.cpp.
void TIndexMatrix::RecomputeIndicesToMatlab | ( | ) |
Recompute indeces, C++ -> MATLAB.
Definition at line 202 of file IndexMatrix.cpp.
|
virtual |
Write data to HDF5 file.
[in] | file | - HDF5 file handle |
[in] | matrixName | - HDF5 dataset name |
[in] | compressionLevel | - compression level |
ios:failure | if error occurs. |
Implements TBaseMatrix.
Definition at line 107 of file IndexMatrix.cpp.