cubecl-core 0.11.0-pre.1

CubeCL core create
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate as cubecl;
use alloc::rc::Rc;
use cubecl::prelude::*;
use cubecl_ir::{DeviceProperties, HardwareProperties};
use cubecl_macros::intrinsic;

/// Retrieves the [`device_properties`](DeviceProperties).
#[cube]
pub fn device_properties() -> comptime_type!(Rc<DeviceProperties>) {
    intrinsic!(|scope| scope.state().device_properties.as_ref().unwrap().clone())
}

/// Retrieves the [`hardware_properties`](HardwareProperties).
#[cube]
pub fn hardware_properties() -> comptime_type!(HardwareProperties) {
    let props = &device_properties().comptime().hardware;
    comptime!(props.clone())
}