oneapi_rs/info.rs
1//
2// Copyright (C) 2026 Intel Corporation
3//
4// Under the MIT License or the Apache License v2.0.
5// See LICENSE-MIT and LICENSE-APACHE for license information.
6// SPDX-License-Identifier: MIT OR Apache-2.0
7//
8
9#[path = "./info/platform-info.rs"]
10pub mod platform;
11
12#[path = "./info/device-info.rs"]
13pub mod device;
14
15#[path = "./info/event-info.rs"]
16pub mod event;
17
18/// The type of the SYCL device.
19pub use oneapi_rs_sys::device::ffi::DeviceType;
20
21/// Event status of the contained action associated with this event.
22pub use oneapi_rs_sys::event::ffi::EventCommandStatus;
23
24use crate::private::Sealed;
25
26/// Types which can return an Item of information for a given Target.
27pub trait Info: Sealed {
28 type Item;
29 type Target;
30
31 /// Returns information for a given Target.
32 fn get_item(target: &Self::Target) -> Self::Item;
33}
34
35/// Types which can be queried for information.
36pub trait InfoTarget: Sealed {
37 /// Queries this object for information requested by given generic parameter.
38 fn get_info<T: Info<Target = Self>>(&self) -> T::Item {
39 T::get_item(self)
40 }
41}