Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
sycl_device.hpp
Go to the documentation of this file.
1#pragma once
2
52
53#include <cstdint>
54#include <optional>
55#include <string>
56
57namespace orrery::backend {
58
65inline constexpr bool kSyclBackendCompiled =
66#ifdef ORRERY_ENABLE_SYCL
67 true;
68#else
69 false;
70#endif
71
79 std::string name;
80
81 std::string vendor;
82
86 std::string driver_version;
87
92 std::string backend;
93
101 unsigned compute_units{};
102
105
108 unsigned sub_group_size{};
109
110 std::uint64_t global_memory_bytes{};
111
114 std::uint64_t local_memory_bytes{};
115
119
124
127
135
145
154 [[nodiscard]] bool supports_build_precision() const noexcept;
155};
156
167[[nodiscard]] std::optional<DeviceDescription> discover_gpu_device() noexcept;
168
175[[nodiscard]] std::optional<DeviceDescription> describe_default_device() noexcept;
176
178[[nodiscard]] std::string to_string(const DeviceDescription& device);
179
180} // namespace orrery::backend
std::string_view to_string(CoreClass core_class) noexcept
A short name for a core class, for benchmark tables and reports.
What the runtime reports about a device, in types that do not require SYCL.
Definition sycl_device.hpp:77
unsigned max_work_group_size
The largest work-group the device will accept.
Definition sycl_device.hpp:104
std::string name
The device's own name, for example "Intel(R) Arc(TM) 130V GPU (16GB)".
Definition sycl_device.hpp:79
bool supports_device_usm
Whether the device can allocate memory only it can address.
Definition sycl_device.hpp:123
bool supports_host_usm
Whether the device can address host allocations.
Definition sycl_device.hpp:126
bool supports_system_usm
Whether the device can address memory from an ordinary new or malloc, with no USM allocator involved ...
Definition sycl_device.hpp:134
std::string driver_version
The driver version, which belongs beside any performance figure.
Definition sycl_device.hpp:86
bool supports_build_precision() const noexcept
True when this device can run the kernel in the precision this build was configured for.
bool supports_double_precision
Whether the device implements double precision.
Definition sycl_device.hpp:144
bool supports_shared_usm
Whether the device can allocate shared unified memory, addressable from both host and device.
Definition sycl_device.hpp:118
std::uint64_t local_memory_bytes
Shared local memory per work-group, which is what a tiled kernel has to fit its block of source parti...
Definition sycl_device.hpp:114
std::string backend
Which runtime the device was reached through, "Level Zero" or "OpenCL".
Definition sycl_device.hpp:92
unsigned sub_group_size
The sub-group size the kernel was compiled for, which on Intel Xe is the SIMD width the hardware actu...
Definition sycl_device.hpp:108
unsigned compute_units
Compute units, which is not the same count as Xe-cores.
Definition sycl_device.hpp:101
std::optional< DeviceDescription > describe_default_device() noexcept
Every device the runtime can see, GPU or not.
constexpr bool kSyclBackendCompiled
Whether this build contains the SYCL backend at all.
Definition sycl_device.hpp:65
std::optional< DeviceDescription > discover_gpu_device() noexcept
The GPU this machine offers, or nothing.