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

CUDA/Thrust implementation of the Brdz algorithm. More...

Inheritance diagram for ska::cheetah::brdz::cuda::Brdz:
Inheritance graph
Collaboration diagram for ska::cheetah::brdz::cuda::Brdz:
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

 Brdz (Config const &impl_config, brdz::Config const &algo_config)
 Create a new Brdz instance. More...
 
 Brdz (Brdz const &)=delete
 
 Brdz (Brdz &&)=default
 
template<typename T , typename Alloc >
void process (ResourceType &gpu, data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< Architecture, T >::type, Alloc > &input)
 Set to zero frequencies marked as birdies. More...
 

Detailed Description

CUDA/Thrust implementation of the Brdz algorithm.

Definition at line 20 of file Brdz.cuh.

Constructor & Destructor Documentation

◆ Brdz()

ska::cheetah::brdz::cuda::Brdz::Brdz ( Config const &  impl_config,
brdz::Config const &  algo_config 
)

Create a new Brdz instance.

Parameters
impl_configThe implementation configuration
algo_configThe algorithm configuration

Member Function Documentation

◆ process()

template<typename T , typename Alloc >
void ska::cheetah::brdz::cuda::Brdz::process ( ResourceType &  gpu,
data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< Architecture, T >::type, Alloc > &  input 
)

Set to zero frequencies marked as birdies.

Parameters
gpuThe gpu to process on
inputThe input frequency series
Template Parameters
TThe base value type of the complex frequency series
AllocThe allocator type of the frequency series

Definition at line 41 of file Brdz.cu.

43 {
44  typedef typename data::ComplexTypeTraits<Architecture,T>::type ComplexType;
45  PANDA_LOG_DEBUG << "GPU ID: "<<gpu.device_id();
46  thrust::device_vector<unsigned> bins;
47  auto const& birdies = _algo_config.birdies();
48  for (auto& birdie: birdies)
49  {
50  std::size_t upper_bin = input.frequency_to_bin(birdie.frequency()+birdie.width() / 2.0);
51  std::size_t lower_bin = input.frequency_to_bin(birdie.frequency()-birdie.width() / 2.0);
52  upper_bin = std::min(upper_bin, input.size());
53  lower_bin = std::max(std::size_t(0), lower_bin);
54  for (std::size_t bin=lower_bin; bin<upper_bin; ++bin)
55  bins.push_back((unsigned)bin);
56  }
57  ComplexType* ptr = thrust::raw_pointer_cast(input.data());
58  thrust::for_each(thrust::cuda::par, bins.begin(), bins.end(), detail::ZapFunctor<T>(ptr));
59 }
std::vector< data::Birdie > const & birdies() const
Get the birdie list.
Definition: Config.cpp:50

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