24 #include "cheetah/utils/test_utils/AlgorithmTester.h" 25 #include "cheetah/utils/System.h" 26 #include <panda/arch/nvidia/DeviceCapability.h> 33 template <
typename Arch>
35 auto operator()() -> decltype( system().resources<Arch>()) {
36 return system().resources<Arch>();
43 auto operator()() -> std::decay<decltype(system().resources<ska::panda::Cpu>())>::type {
44 auto devices = system().resources<ska::panda::Cpu>();
45 if(devices.size() > 1) devices.resize(1);
50 template <
typename Traits>
55 std::copy_if(devices.begin(),devices.end(),std::back_inserter(_devices),
56 [](std::shared_ptr<panda::PoolResource<typename Traits::Arch> >
const& device){
60 if (!_devices.size())
throw panda::Error(
"No suitable device found to run test");
63 template <
typename Traits>
68 template<
typename DeviceType,
typename Traits>
69 struct supports<panda::PoolResource<DeviceType>, Traits>
71 static bool compatible(panda::PoolResource<DeviceType>
const& )
81 template<
typename Traits>
82 struct supports<panda::PoolResource<panda::nvidia::Cuda>, Traits>
84 static bool compatible(panda::PoolResource<panda::nvidia::Cuda>
const& device)
86 typedef typename Traits::Capability Capability;
87 if(
typename Capability::CapabilityVersion(device.device_properties().major, device.device_properties().minor) >=
88 Capability::compute_capability()
89 && (Capability::total_memory <= device.device_properties().totalGlobalMem))
Some limits and constants for FLDO.
Base class for generic algortihm tests that require an accelerator device.
specified how to tell if a given device is capable enough. The ResourceCapability is specifed in the ...