103 cufftResult cufftError;
105 static_cast<int>(inMatrixDims.
nz),
106 static_cast<int>(inMatrixDims.
ny),
107 static_cast<int>(inMatrixDims.
nx),
113 cufftError = cufftSetCompatibilityMode(
cufftPlan_3D_R2C, CUFFT_COMPATIBILITY_NATIVE);
115 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_3D_R2C_Plan");
128 cufftResult_t cufftError;
130 static_cast<int>(outMatrixDims.
nz),
131 static_cast<int>(outMatrixDims.
ny),
132 static_cast<int>(outMatrixDims.
nx),
139 cufftError = cufftSetCompatibilityMode(
cufftPlan_3D_C2R, CUFFT_COMPATIBILITY_NATIVE);
141 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_3D_C2R_Plan");
156 cufftResult_t cufftError;
159 const int nx =
static_cast<int> (inMatrixDims.
nx);
160 const int ny =
static_cast<int> (inMatrixDims.
ny);
161 const int nz =
static_cast<int> (inMatrixDims.
nz);
162 const int nx_2 = ((nx / 2) + 1);
168 int inembed[] = {nx};
172 int onembed[] = {nx_2};
180 inembed, istride, idist,
181 onembed, ostride, odist,
189 cufftError = cufftSetCompatibilityMode(
cufftPlan_1DX_R2C, CUFFT_COMPATIBILITY_NATIVE);
191 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_1DX_R2C_Plan");
206 cufftResult_t cufftError;
209 const int nx =
static_cast<int> (inMatrixDims.
nx);
210 const int ny =
static_cast<int> (inMatrixDims.
ny);
211 const int nz =
static_cast<int> (inMatrixDims.
nz);
212 const int ny_2 = ((ny / 2) + 1);
218 int inembed[] = {ny};
222 int onembed[] = {ny_2};
229 inembed, istride, idist,
230 onembed, ostride, odist,
238 cufftError = cufftSetCompatibilityMode(
cufftPlan_1DY_R2C, CUFFT_COMPATIBILITY_NATIVE);
240 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_1DY_R2C_Plan");
254 cufftResult_t cufftError;
256 const int nx =
static_cast<int> (inMatrixDims.
nx);
257 const int ny =
static_cast<int> (inMatrixDims.
ny);
258 const int nz =
static_cast<int> (inMatrixDims.
nz);
259 const int nz_2 = ((nz / 2) + 1);
265 int inembed[] = {nz};
269 int onembed[] = {nz_2};
276 inembed, istride, idist,
277 onembed, ostride, odist,
285 cufftError = cufftSetCompatibilityMode(
cufftPlan_1DZ_R2C, CUFFT_COMPATIBILITY_NATIVE);
287 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_1DZ_R2C_Plan");
303 cufftResult_t cufftError;
306 const int nx =
static_cast<int> (outMatrixDims.
nx);
307 const int ny =
static_cast<int> (outMatrixDims.
ny);
308 const int nz =
static_cast<int> (outMatrixDims.
nz);
309 const int nx_2 = ((nx / 2) + 1);
315 int inembed[] = {nx_2};
319 int onembed[] = {nx};
326 inembed, istride, idist,
327 onembed, ostride, odist,
335 cufftError = cufftSetCompatibilityMode(
cufftPlan_1DX_C2R, CUFFT_COMPATIBILITY_NATIVE);
337 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_1DX_C2R_Plan");
352 cufftResult_t cufftError;
354 const int nx =
static_cast<int> (outMatrixDims.
nx);
355 const int ny =
static_cast<int> (outMatrixDims.
ny);
356 const int nz =
static_cast<int> (outMatrixDims.
nz);
357 const int ny_2 = ((ny / 2) + 1);
363 int inembed[] = {ny_2};
367 int onembed[] = {ny};
374 inembed, istride, idist,
375 onembed, ostride, odist,
383 cufftError = cufftSetCompatibilityMode(
cufftPlan_1DY_C2R, CUFFT_COMPATIBILITY_NATIVE);
385 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_1DX_C2R_Plan");
400 cufftResult_t cufftError;
403 const int nx =
static_cast<int> (outMatrixDims.
nx);
404 const int ny =
static_cast<int> (outMatrixDims.
ny);
405 const int nz =
static_cast<int> (outMatrixDims.
nz);
406 const int nz_2 = ((nz / 2) + 1);
412 int inembed[] = {nz_2};
416 int onembed[] = {nz};
423 inembed, istride, idist,
424 onembed, ostride, odist,
432 cufftError = cufftSetCompatibilityMode(
cufftPlan_1DZ_C2R, CUFFT_COMPATIBILITY_NATIVE);
434 if (cufftError != CUFFT_SUCCESS)
ThrowCUFFTException(cufftError,
"SetCompatibilty_1DZ_R2C_Plan");
445 cufftResult_t cufftError;
717 const std::string& transformTypeName)
730 throw std::runtime_error(errMsg);
void Compute_FFT_1DY_R2C(TRealMatrix &inMatrix)
Compute 1D out-of-place Real-to-Complex FFT in the Y dimension.
static cufftHandle cufftPlan_1DZ_C2R
cuFFT plan for the 3Z Complex-to-Real transform in the Z dimension.
size_t nx
number of elements in the x direction
TErrorMessage ERR_FMT_CUFFT_INVALID_PLAN
CUDA FFT error message.
static void Create_FFT_Plan_1DZ_R2C(const TDimensionSizes &inMatrixDims)
Create static cuFFT plan for Real-to-Complex in the Z dimension.
TErrorMessage eRR_FMT_CUFFT_SETUP_FAILED
CUDA FFT error message.
void Compute_FFT_3D_C2R(TRealMatrix &outMatrix)
Compute 3D out-of-place Complex-to-Real FFT.
static void DestroyAllPlansAndStaticData()
Destroy all static plans and error messages.
static void Create_FFT_Plan_1DX_R2C(const TDimensionSizes &inMatrixDims)
Create static cuFFT plan for Real-to-Complex in the X dimension.
TErrorMessage ERR_FMT_CUFFT_INVALID_TYPE
CUDA FFT error message.
void Compute_FFT_1DZ_R2C(TRealMatrix &inMatrix)
Compute 1D out-of-place Real-to-Complex FFT in the Z dimension.
The header file containing the class for real matrices.
static void Create_FFT_Plan_1DY_C2R(const TDimensionSizes &outMatrixDims)
Create static cuFFT plan for Complex-to-Real in the Y dimension.
void Compute_FFT_1DY_C2R(TRealMatrix &outMatrix)
Compute 1D out-of-place Complex-to-Real FFT in the Y dimension.
TErrorMessage eRR_FMT_CUFFT_NOT_IMPLEMENTED
CUDA FFT error message.
static void Create_FFT_Plan_1DZ_C2R(const TDimensionSizes &outMatrixDims)
Create static cuFFT plan for Complex-to-Real in the Z dimension.
static cufftHandle cufftPlan_1DX_C2R
cuFFT plan for the 3D Complex-to-Real transform in the X dimension.
static void Create_FFT_Plan_3D_C2R(const TDimensionSizes &outMatrixDims)
Create static cuFFT plan for Complex-to-Real.
TErrorMessage ERR_FMT_CUFFT_INVALID_SIZE
CUDA FFT error message.
static cufftHandle cufftPlan_1DY_R2C
cuFFT plan for the 3D Real-to-Complex transform in the Y dimension.
static cufftHandle cufftPlan_3D_R2C
cuFFT plan for the 3D Real-to-Complex transform.
TErrorMessage ERR_FMT_CUFFT_UNALIGNED_DATA
CUDA FFT error message.
static void Create_FFT_Plan_1DX_C2R(const TDimensionSizes &outMatrixDims)
Create static cuFFT plan for Complex-to-Real in the X dimension.
void Compute_FFT_1DX_R2C(TRealMatrix &inMatrix)
Compute 1D out-of-place Real-to-Complex FFT in the X dimension.
virtual TDimensionSizes GetDimensionSizes() const
Get dimension sizes of the matrix.
static void Create_FFT_Plan_1DY_R2C(const TDimensionSizes &inMatrixDims)
Create static cuFFT plan for Real-to-Complex in the Y dimension.
TErrorMessage ERR_FMT_CUFFT_LICENSE_ERROR
CUDA FFT error message.
The header file containing a class responsible for printing out info and error messages (stdout...
void Compute_FFT_3D_R2C(TRealMatrix &inMatrix)
Compute 3D out-of-place Real-to-Complex FFT.
void Compute_FFT_1DX_C2R(TRealMatrix &outMatrix)
Compute 1D out-of-place Complex-to-Real FFT in the X dimension.
float * deviceData
Raw GPU matrix data.
The header file containing the class that implements 3D FFT using the cuFFT interface.
TErrorMessage ERR_FMT_CUFFT_PARSE_ERROR
CUDA FFT error message.
static cufftHandle cufftPlan_3D_C2R
cuFFT plan for the 3D Complex-to-Real transform.
size_t ny
number of elements in the y direction
static void Create_FFT_Plan_3D_R2C(const TDimensionSizes &inMatrixDims)
Create static cuFFT plan for Real-to-Complex.
TErrorMessage ERR_FMT_CUFFT_EXEC_FAILED
CUDA FFT error message.
The class for real matrices.
void Compute_FFT_1DZ_C2R(TRealMatrix &outMatrix)
Compute 1D out-of-place Complex-to-Real FFT in the Z dimension.
TErrorMessage ERR_FMT_CUFFT_INVALID_DEVICE
CUDA FFT error message.
static void ThrowCUFFTException(const cufftResult cufftError, const std::string &transformTypeName)
Throw an exception with a given error message.
TErrorMessage ERR_FMT_CUFFT_ALLOC_FAILED
CUDA FFT error message.
TErrorMessage ERR_FMT_CUFFT_NO_WORKSPACE
CUDA FFT error message.
static cufftHandle cufftPlan_1DY_C2R
cuFFT plan for the 3D Complex-to-Real transform in the Y dimension.
Name space for all CUDA kernels used in the 3D solver.
static std::string FormatMessage(const std::string &format, Args...args)
C++-11 replacement for sprintf that works with std::string instead of char *.
void TrasposeReal3DMatrixXY(float *outputMatrix, const float *inputMatrix, const dim3 &dimSizes)
Transpose a real 3D matrix in the X-Y direction.
virtual float * GetDeviceData()
Get raw GPU data out of the class (for direct GPU kernel access).
static cufftHandle cufftPlan_1DX_R2C
cuFFT plan for the 1D Real-to-Complex transform in the X dimension.
TErrorMessage ERR_FMT_CUFFT_INCOMPLETE_PARAMETER_LIST
CUDA FFT error message.
TErrorMessage ERR_FMT_CUFFT_INVALID_VALUE
CUDA FFT error message.
static std::map< cufftResult, TErrorMessage > cuFFTErrorMessages
size_t nz
number of elements in the z direction
TErrorMessage ERR_FMT_CUFFT_UNKNOWN_ERROR
CUDA FFT error message.
void TrasposeReal3DMatrixXZ(float *outputMatrix, const float *inputMatrix, const dim3 &dimSizes)
Transpose a real 3D matrix in the X-Y direction.
static cufftHandle cufftPlan_1DZ_R2C
cuFFT plan for the 3D Real-to-Complex transform in the Z dimension.
Structure with 4D dimension sizes (3 in space and 1 in time).