Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Member Functions | List of all members
ska::cheetah::fft::cuda::FftPlan Class Reference
Collaboration diagram for ska::cheetah::fft::cuda::FftPlan:
Collaboration graph

Public Member Functions

 FftPlan ()
 Construct an uninitialised cufft plan.
 
 ~FftPlan ()
 Destroys the undetlying cufft plan if allocated.
 
template<typename T >
cufftHandle const & plan (FftType fft_type, std::size_t size, std::size_t batch)
 Get (or create) a cufft plan. More...
 

Detailed Description

Implementation of FftPlan for cuFFT plans

Definition at line 17 of file FftPlan.cuh.

Member Function Documentation

◆ plan()

template<typename T >
cufftHandle const & ska::cheetah::fft::cuda::FftPlan::plan ( FftType  fft_type,
std::size_t  size,
std::size_t  batch 
)

Get (or create) a cufft plan.

The plan method will first check if its underlying plan matches the provided arguments. If it matches, a reference to the existing plan is returned. If the arguments do not match the configuration of the exiting plan, the existing plan is destroyed and a new one is created.

Parameters
[in]fft_typeThe fft type (R2C, C2R or C2C)
[in]sizeThe size of the transform
[in]batchThe number of transforms to batch
Template Parameters
TBase data type being transformed (float or double)
Returns
A cufftHanle representing the current plan

Definition at line 9 of file FftPlan.cu.

10 {
11  cufftType cufft_type = convert_to_cufft_type<T>(fft_type);
12  if (!valid(cufft_type,size,batch))
13  {
14  destroy_plan();
15  _size = size;
16  _cufft_type = cufft_type;
17  _batch = batch;
18  CUFFT_ERROR_CHECK(cufftPlan1d(&_plan, (int) _size, _cufft_type, (int) _batch));
19  }
20  return _plan;
21 }

The documentation for this class was generated from the following files: