Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
DeviceScheduler.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
19
20namespace sham {
21
29 public:
34 std::shared_ptr<DeviceContext> ctx;
35
40 std::vector<std::unique_ptr<DeviceQueue>> queues;
41
47 explicit DeviceScheduler(std::shared_ptr<DeviceContext> ctx);
48
54 DeviceQueue &get_queue(u32 id = 0);
55
59 void print_info();
60
70 bool use_direct_comm();
71 };
72
73 using DeviceScheduler_ptr = std::shared_ptr<DeviceScheduler>;
74
75 void test_device_scheduler(const DeviceScheduler_ptr &dev_sched);
76
77} // namespace sham
std::uint32_t u32
32 bit unsigned integer
A SYCL queue associated with a device and a context.
Class to manage the scheduling of kernels on a device.
bool use_direct_comm()
Check if the context corresponding to the device scheduler should use direct communication.
std::shared_ptr< DeviceContext > ctx
Reference to the device context associated with this DeviceScheduler.
void print_info()
Print information about the DeviceScheduler.
DeviceQueue & get_queue(u32 id=0)
Get a reference to a DeviceQueue.
std::vector< std::unique_ptr< DeviceQueue > > queues
Vector of unique pointers to the DeviceQueues associated with this DeviceScheduler.
namespace for backends this one is named only sham since shambackends is too long to write