25 #ifndef SKA_CHEETAH_SPS_ASTROACCELERATE_SPS_H 26 #define SKA_CHEETAH_SPS_ASTROACCELERATE_SPS_H 28 #include "cheetah/sps/astroaccelerate/Config.h" 29 #include "cheetah/sps/Config.h" 30 #include "cheetah/utils/Mock.h" 31 #include "cheetah/data/TimeFrequency.h" 33 #ifdef ENABLE_ASTROACCELERATE 35 #include "cheetah/sps/astroaccelerate/detail/SpsCuda.h" 36 #include "cheetah/sps/detail/CommonTypes.h" 37 #include "cheetah/utils/Architectures.h" 38 #include "cheetah/utils/AlgorithmBase.h" 39 #include "cheetah/data/Units.h" 40 #include "cheetah/data/DmTime.h" 41 #include "panda/arch/nvidia/DeviceCapability.h" 44 #include <type_traits> 49 namespace astroaccelerate {
56 template<
class SpsTraits,
typename Enable=
void>
60 typedef cheetah::Cpu Architecture;
63 Sps(sps::Config
const&) {};
65 template<
typename DmHandler,
typename SpHandler,
typename BufferType>
66 void operator()(panda::PoolResource<cheetah::Cpu>&, BufferType&, DmHandler&, SpHandler&);
71 template<
class SpsTraits>
72 using EnableIfIsUint8T =
typename std::enable_if<std::is_same<uint8_t, typename SpsTraits::value_type>::value
73 ||std::is_same<uint16_t, typename SpsTraits::value_type>::value
75 static_assert(std::is_same<
void, EnableIfIsUint8T<sps::CommonTypes<sps::Config, uint8_t>>>::value,
"expecting to recognise uint8_t");
77 template<
class SpsTraits>
78 class Sps<SpsTraits, EnableIfIsUint8T<SpsTraits>> :
private utils::AlgorithmBase<Config, sps::Config>
81 typedef utils::AlgorithmBase<Config, sps::Config> BaseT;
82 typedef sps::CommonTypes<sps::Config, uint8_t> Common;
86 typedef cheetah::Cuda Architecture;
87 typedef panda::nvidia::DeviceCapability<3, 5, panda::nvidia::giga> ArchitectureCapability;
90 typedef uint8_t DataType;
93 typedef data::TimeFrequency<Cpu, uint8_t> TimeFrequencyType;
96 typedef typename Common::BufferType BufferType;
99 Sps(sps::Config
const& config);
100 Sps(Sps&&) =
default;
101 Sps(Sps
const&) =
delete;
106 template<
typename DmHandler,
typename SpHandler>
107 void operator()(panda::PoolResource<cheetah::Cuda>&, BufferType&, DmHandler&, SpHandler&);
112 template<
typename DmHandler,
typename SpHandler,
typename OtherBufferType>
113 void operator()(panda::PoolResource<cheetah::Cuda>&, OtherBufferType&, DmHandler&, SpHandler&);
119 std::size_t set_dedispersion_strategy(std::size_t min_gpu_memory, TimeFrequencyType
const&);
125 std::size_t buffer_overlap()
const;
128 std::size_t set_dedispersion_strategy(std::size_t min_gpu_memory, TimeFrequencyType
const&,
unsigned device_id);
131 std::map<unsigned, SpsCuda> _cuda_runner;
140 #else // ENABLE_ASTROACCELERATE 145 namespace astroaccelerate {
147 template<
class SpsTraits>
156 std::size_t set_dedispersion_strategy(std::size_t, TimeFrequencyType
const&) {
return 0; }
164 #endif // ENABLE_ASTROACCELERATE 166 #include "cheetah/sps/astroaccelerate/detail/Sps.cpp" 167 #endif // SKA_CHEETAH_SPS_ASTROACCELERATE_SPS_H
Some limits and constants for FLDO.