6 #ifndef CPPUDDLE_CONFIG_HPP
7 #define CPPUDDLE_CONFIG_HPP
12 #if defined(CPPUDDLE_HAVE_HPX) && defined(CPPUDDLE_HAVE_HPX_MUTEX)
13 #include <hpx/mutex.hpp>
20 #ifdef CPPUDDLE_HAVE_HPX
21 #ifndef CPPUDDLE_HAVE_HPX_AWARE_ALLOCATORS
23 "Warning: CPPuddle build with HPX support but without HPX-aware allocators enabled. \
24 For better performance configure CPPuddle with CPPUDDLE_WITH_HPX_AWARE_ALLOCATORS=ON!"
27 #include <hpx/include/runtime.hpp>
33 #if defined(CPPUDDLE_HAVE_HPX) && defined(CPPUDDLE_HAVE_HPX_MUTEX)
34 using mutex_t = hpx::spinlock_no_backoff;
53 #ifndef CPPUDDLE_HAVE_HPX
54 static_assert(
max_number_gpus == 1,
"Non HPX builds do not support multigpu");
60 #if defined(CPPUDDLE_HAVE_HPX)
62 return hpx::get_worker_thread_num() % number_gpus;
Definition: config.hpp:31
size_t get_device_id(const size_t number_gpus)
Uses HPX thread information to determine which GPU should be used.
Definition: config.hpp:59
constexpr size_t max_number_gpus
Definition: config.hpp:52
std::mutex mutex_t
Definition: config.hpp:36
constexpr size_t number_instances
Definition: config.hpp:50