Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
DdtrWorker.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/ddtr/astroaccelerate/DdtrWorker.h"
25 
26 
27 namespace ska {
28 namespace cheetah {
29 namespace ddtr {
30 namespace astroaccelerate {
31 
32 
33 template<typename DdtrTraits>
34 DdtrWorker<DdtrTraits>::DdtrWorker(std::shared_ptr<DedispersionStrategy<NumericalRep>> const& strategy)
35  : _strategy(strategy)
36 {
37 }
38 
39 template<typename DdtrTraits>
40 DdtrWorker<DdtrTraits>::~DdtrWorker()
41 {
42 }
43 
44 template<typename DdtrTraits>
45 template<typename BufferType>
46 std::shared_ptr<typename DdtrWorker<DdtrTraits>::DmTrialsType> DdtrWorker<DdtrTraits>::operator()(panda::PoolResource<panda::nvidia::Cuda>& gpu
47  , BufferType const& agg_buf)
48 {
49  //PUSH_NVTX_RANGE("sps_astroaccelerate_DdtrCuda_operator",0);
50  PANDA_LOG << "astroaccelerate:: invoked (on device "<< gpu.device_id() << ")";
51 
52  if (agg_buf.data_size() < (std::size_t) _strategy->maxshift())
53  {
54  const std::string msg("DdtrCuda: data buffer size < maxshift ");
55  PANDA_LOG_ERROR << msg << "(" << agg_buf.data_size() << "<" << _strategy->maxshift() << ")";
56  throw panda::Error(msg);
57  }
58  auto const& start_time = agg_buf.composition().front()->start_time(0);
59  auto dm_trials_ptr = data::DmTrials<Cpu,float>::make_shared(_dm_trial_metadata, start_time);
60  // prepare the DmTime metadata structure
61 
62  /*
63  // run the Cuda kernel
64  _ddtr.run_dedispersion_sps(
65  gpu.device_id()
66  ,tf_data
67  ,*_dm_time
68  ,sps_cands);
69 
70  POP_NVTX_RANGE; //astroaccelerate_run_dedispersion
71 
72  dm_handler(dm_time_ptr);
73  */
74  return dm_trials_ptr;
75 }
76 
77 } // namespace astroaccelerate
78 } // namespace ddtr
79 } // namespace cheetah
80 } // namespace ska
Some limits and constants for FLDO.
Definition: Brdz.h:35