![]() |
kspaceFirstOrder3D-CUDA
1.1
The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class implementing 3D Real-To-Complex and Complex-To-Real transforms using CUDA FFT interface. More...
#include <CUFFTComplexMatrix.h>


Public Member Functions | |
| TCUFFTComplexMatrix (const TDimensionSizes &DimensionSizes) | |
| Constructor (inherited from TComplexMatrix). | |
| virtual | ~TCUFFTComplexMatrix () |
| Destructor (Inherited from TComplexMatrix). | |
| void | Compute_FFT_3D_R2C (TRealMatrix &inMatrix) |
| Compute 3D out-of-place Real-to-Complex FFT. More... | |
| void | Compute_FFT_3D_C2R (TRealMatrix &outMatrix) |
| Compute 3D out-of-place Complex-to-Real FFT. More... | |
| void | Compute_FFT_1DX_R2C (TRealMatrix &inMatrix) |
| Compute 1D out-of-place Real-to-Complex FFT in the X dimension. More... | |
| void | Compute_FFT_1DY_R2C (TRealMatrix &inMatrix) |
| Compute 1D out-of-place Real-to-Complex FFT in the Y dimension. More... | |
| void | Compute_FFT_1DZ_R2C (TRealMatrix &inMatrix) |
| Compute 1D out-of-place Real-to-Complex FFT in the Z dimension. More... | |
| void | Compute_FFT_1DX_C2R (TRealMatrix &outMatrix) |
| Compute 1D out-of-place Complex-to-Real FFT in the X dimension. More... | |
| void | Compute_FFT_1DY_C2R (TRealMatrix &outMatrix) |
| Compute 1D out-of-place Complex-to-Real FFT in the Y dimension. More... | |
| void | Compute_FFT_1DZ_C2R (TRealMatrix &outMatrix) |
| Compute 1D out-of-place Complex-to-Real FFT in the Z dimension. More... | |
Public Member Functions inherited from TComplexMatrix | |
| TComplexMatrix (const TDimensionSizes &dimensionSizes) | |
| Constructor. More... | |
| virtual | ~TComplexMatrix () |
| Destructor. More... | |
| TFloatComplex & | operator[] (const size_t &index) |
| Operator []. More... | |
| const TFloatComplex & | operator[] (const size_t &index) const |
| Operator [], constant version. More... | |
| virtual void | ReadDataFromHDF5File (THDF5_File &file, TMatrixName &matrixName) |
| Load 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... | |
Public Member Functions inherited from TBaseFloatMatrix | |
| 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... | |
Public Member Functions inherited from TBaseMatrix | |
| TBaseMatrix () | |
| Default constructor. | |
| virtual | ~TBaseMatrix () |
| Destructor. | |
Static Public Member Functions | |
| static void | Create_FFT_Plan_3D_R2C (const TDimensionSizes &inMatrixDims) |
| Create static cuFFT plan for Real-to-Complex. More... | |
| static void | Create_FFT_Plan_3D_C2R (const TDimensionSizes &outMatrixDims) |
| Create static cuFFT plan for Complex-to-Real. More... | |
| static void | Create_FFT_Plan_1DX_R2C (const TDimensionSizes &inMatrixDims) |
| Create static cuFFT plan for Real-to-Complex in the X dimension. More... | |
| static void | Create_FFT_Plan_1DY_R2C (const TDimensionSizes &inMatrixDims) |
| Create static cuFFT plan for Real-to-Complex in the Y dimension. More... | |
| static void | Create_FFT_Plan_1DZ_R2C (const TDimensionSizes &inMatrixDims) |
| Create static cuFFT plan for Real-to-Complex in the Z dimension. | |
| static void | Create_FFT_Plan_1DX_C2R (const TDimensionSizes &outMatrixDims) |
| Create static cuFFT plan for Complex-to-Real in the X dimension. | |
| static void | Create_FFT_Plan_1DY_C2R (const TDimensionSizes &outMatrixDims) |
| Create static cuFFT plan for Complex-to-Real in the Y dimension. | |
| static void | Create_FFT_Plan_1DZ_C2R (const TDimensionSizes &outMatrixDims) |
| Create static cuFFT plan for Complex-to-Real in the Z dimension. | |
| static void | DestroyAllPlansAndStaticData () |
| Destroy all static plans and error messages. More... | |
Protected Member Functions | |
| TCUFFTComplexMatrix (const TCUFFTComplexMatrix &src) | |
| Copy constructor not allowed for public. | |
| TCUFFTComplexMatrix & | operator= (const TCUFFTComplexMatrix &src) |
| Operator = not allowed for public. | |
Protected Member Functions inherited from TComplexMatrix | |
| TComplexMatrix () | |
| Default constructor not allowed for public. | |
| TComplexMatrix (const TComplexMatrix &src) | |
| Copy constructor not allowed for public. | |
| TComplexMatrix & | operator= (const TComplexMatrix &src) |
| Operator not allowed for public. | |
| virtual void | InitDimensions (const TDimensionSizes &dimensionSizes) |
| Initialize dimension sizes and related structures. More... | |
Protected Member Functions inherited from TBaseFloatMatrix | |
| 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. | |
Static Protected Attributes | |
| static cufftHandle | cufftPlan_3D_R2C = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3D Real-to-Complex transform. | |
| static cufftHandle | cufftPlan_3D_C2R = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3D Complex-to-Real transform. | |
| static cufftHandle | cufftPlan_1DX_R2C = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 1D Real-to-Complex transform in the X dimension. | |
| static cufftHandle | cufftPlan_1DY_R2C = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3D Real-to-Complex transform in the Y dimension. | |
| static cufftHandle | cufftPlan_1DZ_R2C = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3D Real-to-Complex transform in the Z dimension. | |
| static cufftHandle | cufftPlan_1DX_C2R = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3D Complex-to-Real transform in the X dimension. | |
| static cufftHandle | cufftPlan_1DY_C2R = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3D Complex-to-Real transform in the Y dimension. | |
| static cufftHandle | cufftPlan_1DZ_C2R = static_cast<cufftHandle>(NULL) |
| cuFFT plan for the 3Z Complex-to-Real transform in the Z dimension. | |
Static Private Member Functions | |
| static void | ThrowCUFFTException (const cufftResult cufftError, const std::string &transformTypeName) |
| Throw an exception with a given error message. More... | |
Static Private Attributes | |
| static std::map< cufftResult, TErrorMessage > | cuFFTErrorMessages |
Additional Inherited Members | |
Protected Attributes inherited from TBaseFloatMatrix | |
| 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. | |
Class implementing 3D Real-To-Complex and Complex-To-Real transforms using CUDA FFT interface.
Definition at line 50 of file CUFFTComplexMatrix.h.
| void TCUFFTComplexMatrix::Compute_FFT_1DX_C2R | ( | TRealMatrix & | outMatrix | ) |
Computer inverse out-of-place 1DX Real-to-Complex FFT.
| [out] | outMatrix | - Output data for the inverse FFT. |
| runtime_error | if the plan is not valid. |
Definition at line 626 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_1DX_R2C | ( | TRealMatrix & | inMatrix | ) |
Computer forward out-of-place 1DX Real-to-Complex FFT.
| [in] | inMatrix | - Input data for the forward FFT. |
| runtime_error | if the plan is not valid. |
Definition at line 550 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_1DY_C2R | ( | TRealMatrix & | outMatrix | ) |
Computer inverse out-of-place 1DY Real-to-Complex FFT. The matrix is requested to be in the transposed layout. After the FFT is calculated, an Y<->X transposed follows. The matrix is returned in the normal layout (z, y, x) format.
| [out] | outMatrix | - Output data for the inverse FFT. |
| runtime_error | if the plan is not valid. |
Transpose a real 3D matrix back in the X-Y direction
Definition at line 646 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_1DY_R2C | ( | TRealMatrix & | inMatrix | ) |
Computer forward out-of-place 1DY Real-to-Complex FFT. The matrix is first X<->Y transposed followed by the 1D FFT. The matrix is left in the transposed format.
| [in] | inMatrix | - Input data for the forward FFT. |
| runtime_error | if the plan is not valid. |
Transpose a real 3D matrix in the X-Y direction
Definition at line 569 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_1DZ_C2R | ( | TRealMatrix & | outMatrix | ) |
Computer forward out-of-place 1DY Real-to-Complex FFT. The matrix is requested to be in the transposed layout. After the FFT is calculated, an Z<->X transposed follows. The matrix is returned in the normal layout (z, y, x).
| [out] | outMatrix | - Output data for the inverse FFT. |
| runtime_error | if the plan is not valid. |
Transpose a real 3D matrix in the Z<->X direction
Definition at line 677 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_1DZ_R2C | ( | TRealMatrix & | inMatrix | ) |
Computer forward out-of-place 1DY Real-to-Complex FFT. The matrix is first X<->Z transposed followed by the 1D FFT. The matrix is left in the transposed format.
| [in] | inMatrix | - Input data for the forward FFT. |
| runtime_error | if the plan is not valid. |
Transpose a real 3D matrix in the X-Z direction
Definition at line 598 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_3D_C2R | ( | TRealMatrix & | outMatrix | ) |
Computer forward out-of-place 3D Complex-to-Real FFT.
| [out] | outMatrix | - output of the inverse FFT. |
| runtime_error | if the plan is not valid. |
Definition at line 533 of file CUFFTComplexMatrix.cpp.


| void TCUFFTComplexMatrix::Compute_FFT_3D_R2C | ( | TRealMatrix & | inMatrix | ) |
Computer forward out-of-place 3D Real-to-Complex FFT.
| [in] | inMatrix | - Input data for the forward FFT |
| runtime_error | if the plan is not valid. |
Definition at line 514 of file CUFFTComplexMatrix.cpp.


|
static |
Create cuFFT plan for 1DX Real-to-Complex.
This version doesn't need any scratch place for planning. All 1D transforms are done in a single batch (no transpose needed).
| [in] | inMatrixDims | - The dimension sizes of the input matrix |
| runtime_error | if the plan can't be created. |
Definition at line 154 of file CUFFTComplexMatrix.cpp.


|
static |
Create cuFFT plan for 1DY Real-to-Complex.
This version doesn't need any scratch place for planning. All 1D transforms are done in a single batch. Data has to be transposed before the transform.
| [in] | inMatrixDims | - The dimension sizes of the input matrix |
| runtime_error | if the plan can't be created. |
Definition at line 204 of file CUFFTComplexMatrix.cpp.


|
static |
Create cuFFT plan for Complex-to-Real.
This version doesn't need any scratch place for planning.
| [in] | outMatrixDims | - the dimension sizes of the output matrix |
| runtime_error | if the plan can't be created. |
Definition at line 126 of file CUFFTComplexMatrix.cpp.


|
static |
Create an cuFFT plan for 3D Real-to-Complex.
This version doesn't need any scratch place for planning.
| [in] | inMatrixDims | - The dimension sizes of the input matrix |
| runtime_error | if the plan can't be created. |
Definition at line 101 of file CUFFTComplexMatrix.cpp.


|
static |
Destroy all static plans created by the application.
| runtime_error | if the plan can't be created. |
Definition at line 443 of file CUFFTComplexMatrix.cpp.


|
staticprivate |
Throw cuda FFT exception
| [in] | cufftError | - CUDA FFT error code |
| [in] | transformTypeName | - CUDA transform type name |
| runtime | error if error occurs |
Definition at line 716 of file CUFFTComplexMatrix.cpp.


|
staticprivate |
Error message for the CUFFT class.
Definition at line 132 of file CUFFTComplexMatrix.h.