Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
FftWorker.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 #ifndef SKA_CHEETAH_FFT_ALTERA_FFTWORKER_H
25 #define SKA_CHEETAH_FFT_ALTERA_FFTWORKER_H
26 
27 #ifdef ENABLE_OPENCL
28 #include "cheetah/fft/Config.h"
29 #include "cheetah/data/TimeSeries.h"
30 #include "cheetah/data/FrequencySeries.h"
31 #include "cheetah/data/ComplexTypeTraits.h"
32 #include "panda/arch/altera/Kernel.h"
33 #include "panda/arch/altera/CommandQueue.h"
34 #include "rabbit/cxft/Cxft.h"
35 
36 
37 namespace ska {
38 namespace cheetah {
39 namespace fft {
40 namespace altera {
41 
42 class FftWorker
43 {
44  public:
45  typedef typename cheetah::Fpga Architecture;
46  template<typename T>
47  using Complex = typename data::ComplexTypeTraits<Architecture, T>::type;
48 
49  public:
50  FftWorker(fft::Config const& config, panda::PoolResource<Fpga> const& device);
51 
52  //Copy constructors removed.
53  FftWorker(FftWorker const&) = delete;
54  FftWorker(FftWorker&&) = delete;
55 
56  template <typename T, typename InputAlloc, typename OutputAlloc>
57  void operator()(data::TimeSeries<cheetah::Fpga , T, InputAlloc> const& input,
58  data::FrequencySeries<cheetah::Fpga, Complex<T>, OutputAlloc>& output);
59 
60  private:
61  fft::Config const& _config;
62  panda::PoolResource<panda::altera::OpenCl> const& _device;
63  std::unique_ptr<panda::altera::Kernel> _fetch_kernel;
64  std::unique_ptr<panda::altera::Kernel> _fetch_mwt_kernel;
65  std::unique_ptr<panda::altera::Kernel> _fft_kernel;
66  std::unique_ptr<panda::altera::Kernel> _transpose_kernel;
67  std::unique_ptr<panda::altera::Kernel> _transpose_mwt_kernel;
68  std::unique_ptr<panda::altera::Kernel> _last_kernel;
69  std::unique_ptr<panda::altera::Kernel> _first_kernel;
70  std::unique_ptr<panda::altera::CommandQueue> _first_queue;
71  std::unique_ptr<panda::altera::CommandQueue> _fetch_queue;
72  std::unique_ptr<panda::altera::CommandQueue> _fetch_mwt_queue;
73  std::unique_ptr<panda::altera::CommandQueue> _fft_queue;
74  std::unique_ptr<panda::altera::CommandQueue> _transpose_queue;
75  std::unique_ptr<panda::altera::CommandQueue> _transpose_mwt_queue;
76  std::unique_ptr<panda::altera::CommandQueue> _data_queue;
77  std::unique_ptr<panda::altera::CommandQueue> _last_queue;
78  ska::rabbit::cxft::Cxft _cxft;
79 };
80 
81 
82 } // namespace altera
83 } // namespace fft
84 } // namespace cheetah
85 } // namespace ska
86 
87 #include "cheetah/fft/altera/detail/FftWorker.cpp"
88 
89 #endif // ENABLE_OPENCL
90 #endif // SKA_CHEETAH_FFT_ALTERA_FFTWORKER_H
Some limits and constants for FLDO.
Definition: Brdz.h:35