24 #include "cheetah/sps/Sps.h" 25 #include "panda/ResourcePool.h" 26 #include "panda/TypeTraits.h" 27 #include "panda/Log.h" 35 template<
class ConfigType,
typename NumericalRep>
37 : _pool(config.pool())
38 , _agg_buf_filler( [this](typename BufferFillerType::AggregationBufferType buffer)
40 _task_ptr->submit(std::move(buffer));
42 ,0, config.rfiexcision_config())
43 , _current_number_of_channels(0)
47 if(config.astroaccelerate_config().active()) {
48 #ifdef ENABLE_ASTROACCELERATE 50 , std::move(sp_handler)
54 #else //ENABLE_ASTROACCELERATE 55 PANDA_LOG_WARN <<
"Sps: request for astroaccelearte, but cheetah has not been build with CUDA support. Please use cmake compile flag -DENABLE_CUDA=true";
56 #endif //ENABLE_ASTROACCELERATE 60 if(config.emulator_config().active()) {
62 , std::move(sp_handler)
68 if(_algo_count > 1 ) {
69 throw panda::Error(
"Multiple sps algorithms have been selected");
71 else if(_algo_count == 0)
73 _task_ptr.reset(
new TaskType(std::move(dm_handler), std::move(sp_handler)));
75 _dedisp_samples = config.dedispersion_samples();
79 template<
class ConfigType,
typename NumericalRep>
82 _task_ptr->finish(_agg_buf_filler);
83 PANDA_LOG_DEBUG <<
"~Sps() destructor";
86 template<
class ConfigType,
typename NumericalRep>
91 std::size_t buffer_memory_max = panda::nvidia::min_gpu_memory(_pool);
92 _dedisp_samples = _task_ptr->set_dedispersion_strategy(buffer_memory_max, data);
94 std::size_t overlap = _task_ptr->buffer_overlap();
96 overlap = _config.maximum_delay_offset(data);
98 std::size_t min_memory_size =
sizeof(NumericalRep) * (1 + overlap) * data.
number_of_channels();
99 if(min_memory_size >= buffer_memory_max && buffer_memory_max != 0) {
100 PANDA_LOG_ERROR <<
"configuration error: dedispersion plan requires at least" << overlap + 1
101 <<
" samples (min mem required=" << min_memory_size
102 <<
" , mem available(suitable pool devices)=" << buffer_memory_max <<
")";
103 throw panda::Error(
"dedispersion sample buffer size is too small");
106 if(overlap >= _dedisp_samples) {
107 PANDA_LOG_ERROR <<
"configuration error: samples requested < minimum required for dedispersion plan(" << overlap <<
")";
108 throw panda::Error(
"dedispersion sample buffer size is too small");
110 PANDA_LOG <<
"setting dedispersion buffer size to " << _dedisp_samples <<
" spectra";
113 PANDA_LOG <<
"setting buffer overlap to " << overlap <<
" spectra";
120 template<
class ConfigType,
typename NumericalRep>
121 template<
typename DataT>
126 agg_buffer_init(tf_data);
127 _agg_buf_filler << data;
130 PANDA_LOG_WARN <<
"No available Sps algorithm";
134 template<
class ConfigType,
typename NumericalRep>
137 this->
template agg_buffer_fill(data);
140 template<
class ConfigType,
typename NumericalRep>
143 this->
template agg_buffer_fill(data);
146 template<
class ConfigType,
typename NumericalRep>
Single pulse search asynchronous task.
Produces a stream of random SpCandidate's.
Single Pulse Search top level interface.
TimeFrequency data with flags representing rfim detection.
Some limits and constants for FLDO.
std::size_t number_of_channels() const
Sps(ConfigType const &, DmHandler dm_handler, SpHandler sm_handler)
Constructor takes two Handlers.