Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DredTester.cpp
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "cheetah/dred/test_utils/DredTester.h"
25 #include "cheetah/data/FrequencySeries.h"
26 #include "cheetah/utils/Architectures.h"
27 #include "cheetah/data/Units.h"
28 #include "cheetah/data/ComplexTypeTraits.h"
29 
30 #include <iostream>
31 #include <memory>
32 
33 namespace ska {
34 namespace cheetah {
35 namespace dred {
36 namespace test {
37 
38 template<typename ArchitectureTag, typename ArchitectureCapability, typename T>
39 DredTesterTraits<ArchitectureTag,ArchitectureCapability,T>::DredTesterTraits()
40  : _api(_config)
41 {
42 }
43 
44 template<typename ArchitectureTag, typename ArchitectureCapability, typename T>
45 dred::Dred<T>& DredTesterTraits<ArchitectureTag,ArchitectureCapability,T>::api()
46 {
47  return _api;
48 }
49 
50 template<typename ArchitectureTag, typename ArchitectureCapability, typename T>
51 dred::Config& DredTesterTraits<ArchitectureTag,ArchitectureCapability, T>::config()
52 {
53  return _config;
54 }
55 
56 template <typename DeviceType, typename Arch, typename T>
57 struct ExecTest
58 {
59  inline static void test(DeviceType& device, dred::Dred<T>& api)
60  {
61  typedef typename data::ComplexTypeTraits<Arch,T>::type ComplexType;
62  data::FrequencySeries<Arch,ComplexType> input(0.333 * data::hz);
64  data::AccelerationType maximum_acceleration = 100.0 * data::meters_per_second_squared;
65  api.process(device,input,output,maximum_acceleration);
66  }
67 };
68 
69 template <typename TestTraits>
72 {
73 }
74 
75 template <typename TestTraits>
77 {
78 }
79 
80 template<typename TestTraits>
82 {
83 }
84 
85 template<typename TestTraits>
87 {
88 }
89 
90 ALGORITHM_TYPED_TEST_P(DredTester, test_exec)
91 {
92  TypeParam traits;
93  auto& config = traits.config();
94  auto& api = traits.api();
96 }
97 
98 // each test defined by ALGORITHM_TYPED_TEST_P must be added to the
99 // test register (each one as an element of the comma seperated list)
100 REGISTER_TYPED_TEST_CASE_P(DredTester, test_exec);
101 
102 } // namespace test
103 } // namespace dred
104 } // namespace cheetah
105 } // namespace ska
void process(panda::PoolResource< Arch > &resource, data::FrequencySeries< Arch, typename data::ComplexTypeTraits< Arch, T >::type, Alloc >const &input, data::FrequencySeries< Arch, typename data::ComplexTypeTraits< Arch, T >::type, Alloc > &output, data::AccelerationType maximum_acceleration, Args &&... args)
Deredden a complex frequency series.
Definition: Dred.cpp:45
Class for implementing spectral dereddening.
Definition: Dred.h:46
A container of Fourier series data.
A helper class to determine the type of complex data for different architectures. ...
Some limits and constants for FLDO.
Definition: Brdz.h:35