Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Types | Public Member Functions | List of all members
ska::cheetah::pwft::cuda::Pwft Class Reference

Cuda implementation of the Power Spectrum Fourier Transform module. More...

Inheritance diagram for ska::cheetah::pwft::cuda::Pwft:
Inheritance graph
Collaboration diagram for ska::cheetah::pwft::cuda::Pwft:
Collaboration graph

Public Types

typedef cheetah::Cuda Architecture
 
typedef panda::nvidia::DeviceCapability< 2, 0, panda::nvidia::giga/2 > ArchitectureCapability
 
typedef panda::PoolResource< Architecture > ResourceType
 

Public Member Functions

 Pwft (Config const &config, pwft::Config const &algo_config)
 Construct a new instance. More...
 
 Pwft (Pwft const &)=delete
 
 Pwft (Pwft &&)=default
 
template<typename T , typename InputAlloc , typename OutputAlloc >
void process_direct (ResourceType &gpu, data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< cheetah::Cuda, T >::type, InputAlloc > const &input, data::PowerSeries< Architecture, T, OutputAlloc > &output)
 Form power spectrum using absolute squared. More...
 
template<typename T , typename InputAlloc , typename OutputAlloc >
void process_nn (ResourceType &gpu, data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< cheetah::Cuda, T >::type, InputAlloc > const &input, data::PowerSeries< Architecture, T, OutputAlloc > &output)
 Form power spectrum using absolute squared with nearest neighbour comparison. More...
 

Detailed Description

Cuda implementation of the Power Spectrum Fourier Transform module.

Definition at line 25 of file Pwft.cuh.

Constructor & Destructor Documentation

◆ Pwft()

ska::cheetah::pwft::cuda::Pwft::Pwft ( Config const &  config,
pwft::Config const &  algo_config 
)

Construct a new instance.

Parameters
configA cuda::Pwft configuration object

Definition at line 10 of file Pwft.cu.

11  : utils::AlgorithmBase<Config, pwft::Config>(config,algo_config)
12 {
13 }

Member Function Documentation

◆ process_direct()

template<typename T , typename InputAlloc , typename OutputAlloc >
void ska::cheetah::pwft::cuda::Pwft::process_direct ( ResourceType &  gpu,
data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< cheetah::Cuda, T >::type, InputAlloc > const &  input,
data::PowerSeries< Architecture, T, OutputAlloc > &  output 
)

Form power spectrum using absolute squared.

Each power measurement is found by output[i] = |input[i]|^2

Parameters
gpuThe gpu resource to process on
[in]inputA FrequencySeries object of complex data type
[out]outputA FrequencySeries object of real data type
Template Parameters
TThe value type of the input and output FrequencySeries
InputAllocThe allocator type of the input FrequencySeries
OutputAllocThe allocator type of the output FrequencySeries

Definition at line 45 of file Pwft.cu.

48 {
49  PANDA_LOG_DEBUG << "GPU ID: "<<gpu.device_id();
50  output.resize(input.size());
51  output.frequency_step(input.frequency_step());
52  output.degrees_of_freedom(2.0);
53  thrust::transform(thrust::cuda::par,
54  input.begin(),
55  input.end(),output.begin(),
56  detail::FormPower<T>());
57 }
Here is the call graph for this function:

◆ process_nn()

template<typename T , typename InputAlloc , typename OutputAlloc >
void ska::cheetah::pwft::cuda::Pwft::process_nn ( ResourceType &  gpu,
data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< cheetah::Cuda, T >::type, InputAlloc > const &  input,
data::PowerSeries< Architecture, T, OutputAlloc > &  output 
)

Form power spectrum using absolute squared with nearest neighbour comparison.

Each power measurement is found by comparing neighbouring bins such that output[i] = max(|input[i]|^2, |input[i]-input[i-1]|^2)

Parameters
gpuThe gpu resource to process on
[in]inputA FrequencySeries object of complex data type
[out]outputA FrequencySeries object of real data type
Template Parameters
TThe value type of the input and output FrequencySeries
InputAllocThe allocator type of the input FrequencySeries
OutputAllocThe allocator type of the output FrequencySeries

Definition at line 60 of file Pwft.cu.

63 {
64  PANDA_LOG_DEBUG << "GPU ID: "<<gpu.device_id();
65  output.resize(input.size());
66  output.frequency_step(input.frequency_step());
67  output.degrees_of_freedom(2.0+RSQRT2);
68  output[0] = 0;
69  thrust::transform(thrust::cuda::par,
70  input.begin()+1, input.end(),
71  input.begin(), output.begin()+1,
72  detail::FormPowerNN<T>());
73 }
Here is the call graph for this function:

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