![]() |
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 real matrices. More...
#include <RealMatrix.h>
Public Member Functions | |
TRealMatrix (const TDimensionSizes &dimensionSizes) | |
Constructor. More... | |
virtual | ~TRealMatrix () |
Destructor. More... | |
virtual void | ReadDataFromHDF5File (THDF5_File &file, TMatrixName &matrixName) |
Read data from the HDF5 file - only from the root group. More... | |
virtual void | WriteDataToHDF5File (THDF5_File &file, TMatrixName &matrixName, const size_t compressionLevel) |
Write data into the HDF5 file. More... | |
float & | operator[] (const size_t &index) |
Operator []. More... | |
const float & | operator[] (const size_t &index) const |
Operator [], constant version. More... | |
TRealMatrix () | |
Default constructor is not allowed for public. | |
TRealMatrix (const TRealMatrix &src) | |
Copy constructor not allowed for public. | |
TRealMatrix & | operator= (const TRealMatrix &src) |
Operator = is not allowed for public. | |
virtual void | InitDimensions (const TDimensionSizes &dimensionSizes) |
Init dimension sizes. More... | |
![]() | |
TBaseFloatMatrix () | |
Default constructor. More... | |
virtual TDimensionSizes | GetDimensionSizes () const |
Get dimension sizes of the matrix. | |
virtual size_t | GetElementCount () const |
Get 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 void | ScalarDividedBy (const float scalar) |
Divide scalar/ matrix_element[i]. More... | |
virtual float * | GetHostData () |
Get raw CPU data out of the class (for direct CPU kernel access). | |
virtual const float * | GetHostData () const |
Get raw CPU data out of the class (for direct CPU kernel access). | |
virtual float * | GetDeviceData () |
Get raw GPU data out of the class (for direct GPU kernel access). | |
virtual const float * | 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. | |
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 | |
![]() | |
virtual void | AllocateMemory () |
Memory allocation (both on CPU and GPU). More... | |
virtual void | FreeMemory () |
Memory allocation (both on CPU and GPU). More... | |
TBaseFloatMatrix (const TBaseFloatMatrix &src) | |
Copy constructor is not directly allowed. | |
TBaseFloatMatrix & | operator= (const TBaseFloatMatrix &src) |
Operator = is not directly allowed. | |
![]() | |
size_t | nElements |
Total number of elements. | |
size_t | nAllocatedElements |
Total number of allocated elements (in terms of floats). | |
struct TDimensionSizes | dimensionSizes |
Dimension sizes. | |
size_t | dataRowSize |
Size of a 1D row in X dimension. | |
size_t | dataSlabSize |
Size of a 2D slab. | |
float * | hostData |
Raw CPU matrix data. | |
float * | deviceData |
Raw GPU matrix data. | |
The class for real matrices (floats) on both CPU and GPU side
Definition at line 45 of file RealMatrix.h.
TRealMatrix::TRealMatrix | ( | const TDimensionSizes & | dimensionSizes | ) |
Constructor.
[in] | dimensionSizes | - Dimension sizes of the matrix |
Definition at line 49 of file RealMatrix.cpp.
|
virtual |
|
virtual |
Set necessary dimensions and auxiliary variables.
[in] | dimensionSizes | - 3D Dimension sizes |
Definition at line 152 of file RealMatrix.cpp.
|
inline |
Operator [].
[in] | index | - 1D index |
Definition at line 68 of file RealMatrix.h.
|
inline |
Operator [], constant version.
[in] | index | - 1D index |
Definition at line 79 of file RealMatrix.h.
|
virtual |
Read data data from HDF5 file (only from the root group).
[in] | file | - HDF5 file |
[in] | matrixName | - HDF5 dataset name |
ios::failure | if error occurred. |
Implements TBaseMatrix.
Definition at line 74 of file RealMatrix.cpp.
|
virtual |
Write data to HDF5 file (only from the root group).
[in] | file | - HDF5 file |
[in] | matrixName | - HDF5 Matrix name |
[in] | compressionLevel | - Compression level |
ios::failure | if an error occurred. |
Implements TBaseMatrix.
Definition at line 102 of file RealMatrix.cpp.