Skip to main content

cubecl_core/frontend/
comptime.rs

1use crate as cubecl;
2use alloc::rc::Rc;
3use cubecl::prelude::*;
4use cubecl_ir::{DeviceProperties, HardwareProperties};
5use cubecl_macros::intrinsic;
6
7/// Retrieves the [`device_properties`](DeviceProperties).
8#[cube]
9pub fn device_properties() -> comptime_type!(Rc<DeviceProperties>) {
10    intrinsic!(|scope| scope.state().device_properties.as_ref().unwrap().clone())
11}
12
13/// Retrieves the [`hardware_properties`](HardwareProperties).
14#[cube]
15pub fn hardware_properties() -> comptime_type!(HardwareProperties) {
16    let props = &device_properties().comptime().hardware;
17    comptime!(props.clone())
18}