Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Tdao.cuh
1 #ifndef SKA_CHEETAH_TDAO_CUDA_TDAO_H
2 #define SKA_CHEETAH_TDAO_CUDA_TDAO_H
3 
4 #include "cheetah/tdao/Config.h"
5 #include "cheetah/tdao/cuda/Config.h"
6 #include "cheetah/data/PowerSeries.h"
7 #include "cheetah/data/CachingAllocator.h"
8 #include "cheetah/data/Ccl.h"
9 #include "cheetah/data/Units.h"
10 #include "cheetah/data/DedispersionMeasure.h"
11 #include "cheetah/utils/Architectures.h"
12 #include "cheetah/utils/AlgorithmBase.h"
13 #include "cheetah/cuda_utils/cuda_thrust.h"
14 
15 #include "panda/arch/nvidia/DeviceCapability.h"
16 
17 namespace ska {
18 namespace cheetah {
19 namespace tdao {
20 namespace cuda {
21 
22 
26 class Tdao
27  : public utils::AlgorithmBase<Config,tdao::Config>
28 {
29  public:
30  typedef cheetah::Cuda Architecture;
31  typedef panda::nvidia::DeviceCapability<2,0, panda::nvidia::giga/2> ArchitectureCapability;
32  typedef panda::PoolResource<Architecture> ResourceType;
33 
34  public:
41  Tdao(Config const& config, tdao::Config const& algo_config);
42  Tdao(Tdao const&) = delete;
43  Tdao(Tdao&&) = default;
44  ~Tdao();
45 
59  template <typename T, typename Alloc>
60  void process(ResourceType& gpu,
62  data::Ccl& output,
63  data::DedispersionMeasureType<float> dm,
64  data::AccelerationType acc,
65  std::size_t nharmonics);
66 
67  private:
73  void _prepare(std::size_t size);
74 
79  template <typename PowerSeriesType>
80  void _filter_unique(PowerSeriesType const& input,
81  data::Ccl& output,
82  std::size_t num_copied,
83  data::DedispersionMeasureType<float> dm,
84  data::AccelerationType acc,
85  std::size_t nharmonics);
86 
90  template <typename PowerSeriesType>
91  data::Ccl::CandidateType _make_candidate(
92  unsigned idx,
93  float power,
94  PowerSeriesType const& input,
95  data::DedispersionMeasureType<float> dm,
96  double accel_fact,
97  std::size_t nharmonics);
98 
102  template <typename T>
103  std::size_t _execute(typename thrust::device_vector<T>::const_iterator in, std::size_t size,
104  std::size_t offset, float threshold);
105 
107  thrust::device_vector<unsigned> _idxs;
108  thrust::device_vector<float> _powers;
109  thrust::host_vector<unsigned> _h_idxs;
110  thrust::host_vector<float> _h_powers;
111 };
112 
113 } // namespace cuda
114 } // namespace tdao
115 } // namespace cheetah
116 } // namespace ska
117 
118 #include "cheetah/tdao/cuda/detail/Tdao.cu"
119 
120 #endif // SKA_CHEETAH_TDAO_CUDA_TDAO_H
void process(ResourceType &gpu, data::PowerSeries< Architecture, T, Alloc >const &input, data::Ccl &output, data::DedispersionMeasureType< float > dm, data::AccelerationType acc, std::size_t nharmonics)
Find peaks in a power series above a statistical threshold.
Definition: Tdao.cu:141
Some limits and constants for FLDO.
Definition: Brdz.h:35
Class for power series (detected FrequencySeries).
Definition: PowerSeries.h:58
Candidate list.
Definition: Ccl.h:45
CUDA/Thrust implementation of the Tdao module.
Definition: Tdao.cuh:26
Tdao(Config const &config, tdao::Config const &algo_config)
Construct a new Tdao object.
Definition: Tdao.cu:9
A simple record to hold &#39;candidate&#39; proprerties.
Definition: Candidate.h:60