Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
FftWorker.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/fft/altera/detail/FftWorker.h"
25 #include "cheetah/fft/altera/Fft.h"
26 #include "panda/Error.h"
27 #include "panda/Log.h"
28 #ifdef ENABLE_OPENCL
29 #include "panda/arch/altera/Aocx.h"
30 #include "panda/arch/altera/Program.h"
31 #endif // ENABLE_OPENCL
32 
33 
34 namespace ska {
35 namespace cheetah {
36 namespace fft {
37 namespace altera {
38 
39 
40 #ifdef ENABLE_OPENCL
41 FftWorker::FftWorker(fft::Config const& config, panda::PoolResource<Fpga> const& device)
42  : _config(config)
43  , _device(device)
44  , _first_queue(new panda::altera::CommandQueue(_device))
45  , _fetch_queue(new panda::altera::CommandQueue(_device))
46  , _fetch_mwt_queue(new panda::altera::CommandQueue(_device))
47  , _fft_queue(new panda::altera::CommandQueue(_device))
48  , _transpose_queue(new panda::altera::CommandQueue(_device))
49  , _transpose_mwt_queue(new panda::altera::CommandQueue(_device))
50  , _data_queue(new panda::altera::CommandQueue(_device))
51  , _last_queue(new panda::altera::CommandQueue(_device))
52 {
53  std::string filename;
54  const std::string str = _device.device_name();
55  filename=_cxft.eight_million_point_image(_device.device_id());
56  PANDA_LOG << "\nRabbit CXFT image: " << filename << " found for the device " << str;
57  ska::panda::altera::Aocx aocx(filename);
58  ska::panda::altera::Program program(aocx,_device);
59  _first_kernel.reset(new panda::altera::Kernel("first_stage", program));
60  _fetch_kernel.reset(new panda::altera::Kernel("fetch", program));
61  _fetch_mwt_kernel.reset(new panda::altera::Kernel("fetch_MWT", program));
62  _fft_kernel.reset(new panda::altera::Kernel("fft1d", program));
63  _transpose_kernel.reset(new panda::altera::Kernel("transpose", program));
64  _transpose_mwt_kernel.reset(new panda::altera::Kernel("transpose_MWT", program));
65  _last_kernel.reset(new panda::altera::Kernel("last_stage", program));
66 }
67 #endif // ENABLE_OPENCL
68 
69 } // namespace altera
70 } // namespace fft
71 } // namespace cheetah
72 } // namespace ska
Some limits and constants for FLDO.
Definition: Brdz.h:35