10#ifdef CompilerHasSysinfo
16#if defined(SharedSYCL)
20#pragma push_macro("Dimensions")
21#pragma push_macro("assertion")
25#pragma pop_macro("Dimensions")
26#pragma pop_macro("assertion")
34 sycl::queue hostSyclQueue( sycl::cpu_selector_v );
38sycl::queue& tarch::multicore::getHostSYCLQueue() {
47 _numberOfThreads( -1 ) {
49 sycl::device cpuDevice;
51 cpuDevice = sycl::device( sycl::cpu_selector_v );
53 std::cerr <<
"Warning, failed at selecting cpu device" << std::endl;
57 sycl::queue cpuQueue( cpuDevice );
58 hostSyclQueue = cpuQueue;
60 _numberOfThreads = hostSyclQueue.get_device().get_info<sycl::info::device::max_compute_units>();
64 std::cout <<
"host (CPU) device queue:" << hostSyclQueue.get_device().get_info<sycl::info::device::name>()
65 <<
" with " << _numberOfThreads <<
" threads" << std::endl;
82 if ( numberOfThreads!=_numberOfThreads ) {
83 logWarning(
"configure(int)",
"can not reconfigure number of threads within SYCL queue. Will work with " << numberOfThreads <<
" logical threads within host queue having " << _numberOfThreads <<
" threads" );
85 _numberOfThreads = numberOfThreads;
100 return _numberOfThreads;
105 #ifdef CompilerHasSysinfo
106 return sched_getcpu();
124 hostSyclQueue.wait();
#define logWarning(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
static constexpr int UseDefaultNumberOfThreads
The default is what the system management typically gives you.
bool isInitialised() const
int getCoreNumber() const
static Core & getInstance()
int getNumberOfThreads() const
Returns the number of threads that is used.
static tarch::logging::Log _log
Logging device.
void configure(int numberOfThreads=UseDefaultNumberOfThreads)
Configure the whole node, i.e.
void shutdown()
Shutdown parallel environment.
int getThreadNumber() const
void yield()
Wrapper around backend-specific yield.
void processAllReadyTasks()