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