23 : default_device_num(-1),
25 #
if defined(ENABLE_CUDA)
26 , cuda_dm_(default_device_num, num_devices, local_rank, local_size)
28 #
if defined(ENABLE_OFFLOAD)
29 , omptarget_dm_(default_device_num, num_devices, local_rank, local_size)
31 #
if defined(ENABLE_SYCL)
32 , sycl_dm_(default_device_num, num_devices, local_rank, local_size)
38 app_warning() <<
"The number of MPI ranks on the node is not divisible by the number of accelerators. " 39 <<
"Imbalanced load may cause performance loss.\n";
52 throw std::runtime_error(
53 "DeviceManager::initializeGlobalDeviceManager the global instance cannot be initialized again.");
54 global = std::make_unique<DeviceManager>(local_rank, local_size);
60 throw std::runtime_error(
"DeviceManager::getGlobal the global instance was not initialized.");
std::ostream & app_warning()
helper functions for EinsplineSetBuilder
Declaration of OutputManager class.
DeviceManager(int local_rank, int local_size)
constructor
static std::unique_ptr< DeviceManager > global
the global singleton which can be used to query default devices and all the captured devices...
static const DeviceManager & getGlobal()
global instance accessor
orchestrate platforms (programming models) and set up the default device on each platform ...
static void initializeGlobalDeviceManager(int local_rank, int local_size)
initialize the global instance of DeviceManager arguments are the same as the constructor ...
int num_devices
the number of devices. Must be defined before platform device manager objects