Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Fldo.cuh
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 #ifndef SKA_CHEETAH_FLDO_CUDA_FLDO_CUH
25 #define SKA_CHEETAH_FLDO_CUDA_FLDO_CUH
26 
27 #include "cheetah/fldo/cuda/detail/FldoCuda.h"
28 #include "cheetah/fldo/Config.h"
29 #include "panda/DeviceLocal.h"
30 
31 namespace ska {
32 namespace cheetah {
33 namespace fldo {
34 namespace cuda {
35 namespace detail {
36 
37 // pre-compilable parts (i.e does not depend on template params)
38 class FldoBase
39 {
40  public:
41  typedef cheetah::Cuda Architecture;
42  typedef panda::PoolResource<Architecture> ResourceType;
43 
44  protected:
45  struct RunnerFactory {
46  public:
48 
49  protected:
50  void operator()(ResourceType const& gpu);
51 
52  protected:
53  fldo::Config const& _config;
54  };
55 
56 };
57 
64 template<class FldoTraits>
65 class Fldo : FldoBase
66 {
67  public:
68  typedef panda::nvidia::DeviceCapability<2,0, panda::nvidia::giga/2> ArchitectureCapability; // minimum device requirements
69  typedef cuda::Config Config;
70 
71  private:
73  typedef FldoCuda<typename TimeFrequencyType::value_type> WorkerType;
74 
75  public:
76  Fldo(fldo::Config const& config);
77 
81  std::shared_ptr<data::Ocld> operator()(ResourceType& device
82  , std::vector<std::shared_ptr<TimeFrequencyType>> const& data
83  , data::Scl const& input_candidates);
84 
93  int fldo_input_check(const fldo::Config & ) ;
94 
95  private:
96  struct RunnerFactory : public FldoBase::RunnerFactory
97  {
98  typedef FldoBase::RunnerFactory BaseT;
99 
100  public:
101  using FldoBase::RunnerFactory::RunnerFactory;
102  WorkerType* operator()(ResourceType const& gpu);
103  };
104 
105  private:
106  panda::DeviceLocal<panda::PoolResource<cheetah::Cuda>, RunnerFactory> _cuda_runner;
107 };
108 
109 } // namespace detail
110 } // namespace cuda
111 } // namespace fldo
112 } // namespace cheetah
113 } // namespace ska
114 #include "Fldo.cpp"
115 
116 #endif // SKA_CHEETAH_FLDO_CUDA_FLDO_CUH
Some limits and constants for FLDO.
Definition: Brdz.h:35
Sifted Candidate List.
Definition: Scl.h:45
The interface for the CUDA FLDO algorithm.
Definition: Fldo.cuh:65
Configuration details for the fldo module.
Definition: Config.h:51