Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
FrequencyTime.h
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 
25 #ifndef SKA_CHEETAH_DATA_CUDA_FREQUENCYTIME_H
26 #define SKA_CHEETAH_DATA_CUDA_FREQUENCYTIME_H
27 
28 #include "cheetah/data/cuda/TimeFrequency.h"
29 #include "cheetah/data/FrequencyTime.h"
30 #include "panda/arch/nvidia/DeviceMemory.h"
31 
32 #ifdef ENABLE_CUDA
33 
34 namespace ska {
35 namespace cheetah {
36 namespace data {
37 
38 
39 template <typename NumericalT>
40 class FrequencyTime<Cuda, NumericalT> : public TimeFrequencyCommon<FrequencyTime<Cuda, NumericalT>>
41 {
42  typedef TimeFrequencyCommon<FrequencyTime<Cuda, NumericalT>> CommonBase;
43  typedef panda::DeviceMemory<Cuda, NumericalT> ContainerType;
44 
45  public:
49  typedef NumericalT DataType;
50  typedef NumericalT NumericalRep;
51 
52  typedef typename CommonBase::FrequencyType FrequencyType;
53  typedef typename CommonBase::TimeType TimeType;
54  typedef typename CommonBase::TimePointType TimePointType;
55 
56  typedef typename ContainerType::Iterator Iterator;
57  typedef typename ContainerType::ConstIterator ConstIterator;
58 
59  public:
60  FrequencyTime(FrequencyTime<Cuda, NumericalT> const& ft);
61 
62  template<typename OtherArch, typename OtherNumericalT>
63  FrequencyTime(FrequencyTime<OtherArch, OtherNumericalT> const& ft);
64 
65  template <typename OtherNumericalT>
66  FrequencyTime(TimeFrequency<Cuda, OtherNumericalT> const& tf);
67 
68  template <typename OtherNumericalT>
69  FrequencyTime(TimeFrequency<Cpu, OtherNumericalT> const& tf);
70 
74  Iterator begin();
75  ConstIterator begin() const;
76  ConstIterator cbegin() const;
77 
81  Iterator end();
82  ConstIterator end() const;
83  ConstIterator cend() const;
84 
88  std::size_t number_of_channels() const;
89 
93  std::size_t number_of_spectra() const;
94 
95  private:
96  ContainerType _data;
97  std::size_t _number_of_channels;
98  std::size_t _number_of_spectra;
99 
100 };
101 
102 }
103 }
104 }
105 
106 #include "cheetah/data/cuda/detail/FrequencyTime.cpp"
107 
108 #endif // ENABLE_CUDA
109 #endif // SKA_CHEETAH_DATA_CUDA_FREQUENCYTIME_H
NumericalT DataType
the underlying data storage type for the amplitude of the signal
Definition: FrequencyTime.h:98
Some limits and constants for FLDO.
Definition: Brdz.h:35