Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
SumThresholdTest.cpp
1 #include "cheetah/rfim/sum_threshold/test/SumThresholdTest.h"
2 #include "cheetah/rfim/sum_threshold/Rfim.h"
3 #include "cheetah/rfim/test_utils/RfimTester.h"
4 #include <memory>
5 
6 
7 namespace ska {
8 namespace cheetah {
9 namespace rfim {
10 namespace sum_threshold {
11 namespace test {
12 
13 template<typename NumericalRepT>
14 struct SumThresholdRfimTraits : public rfim::DefaultRfimTraits<data::TimeFrequency<Cpu, NumericalRepT>>
15 {
16  typedef NumericalRepT NumericalRep;
20  using typename BaseT::Policy;
21  using typename BaseT::BandPassHandler;
22 };
23 
24 template<typename NumericalRep>
25 struct SumThresholdTraits : public rfim::test::RfimTesterTraits<NumericalRep, cheetah::Cpu> {
26  public:
28  typedef typename BaseT::ResultType ResultType;
29  typedef typename BaseT::DataType DataType;
30 
32 
33  template<typename DeviceType>
34  ResultType apply_algorithm(DeviceType&&, DataType& data);
35 
37 
38  private:
41  bool _initialised;
42 };
43 
44 template<typename NumericalRep>
46  : _algo(_config)
47 {
48 }
49 
50 template<typename NumericalRep>
51 template<typename DeviceType>
52 typename SumThresholdTraits<NumericalRep>::ResultType SumThresholdTraits<NumericalRep>::apply_algorithm(DeviceType&& d, DataType& data)
53 {
54  return algo()(std::forward<DeviceType>(d), data.shared_from_this());
55 }
56 
57 template<typename NumericalRep>
59 {
60  //static rfim::sum_threshold::Rfim<SumThresholdRfimTraits<NumericalRep>> algo_api(_config);
61  return _algo;
62 }
63 
64 SumThresholdTest::SumThresholdTest()
65  : ::testing::Test()
66 {
67 }
68 
69 SumThresholdTest::~SumThresholdTest()
70 {
71 }
72 
73 void SumThresholdTest::SetUp()
74 {
75 }
76 
77 void SumThresholdTest::TearDown()
78 {
79 }
80 
81 /*
82 TEST_F(SumThresholdTest, test_something)
83 {
84 }
85 */
86 
87 
88 } // namespace test
89 } // namespace sum_threshold
90 namespace test {
91  typedef ::testing::Types<rfim::sum_threshold::test::SumThresholdTraits<uint8_t>> SumThresholdTraitsTypes;
92  INSTANTIATE_TYPED_TEST_CASE_P(SumThreshold, RfimTester, SumThresholdTraitsTypes);
93 } // namespace test
94 } // namespace rfim
95 } // namespace cheetah
96 } // namespace ska
A CPU implementation of the sum_threshold algorithm.
Definition: Rfim.h:23
Some limits and constants for FLDO.
Definition: Brdz.h:35