use crate::{
frontend::{NativeExpand, element::Atomic},
ir::{Instruction, Scope, Synchronization},
prelude::{CubePrimitive, Numeric},
unexpanded,
};
use cubecl_ir::Operation;
pub fn sync_cube() {}
pub mod sync_cube {
use super::*;
pub fn expand(scope: &Scope) {
scope.register(Synchronization::SyncCube)
}
}
pub fn sync_plane() {
unexpanded!()
}
pub mod sync_plane {
use super::*;
pub fn expand(scope: &Scope) {
scope.register(Synchronization::SyncPlane);
}
}
pub fn sync_storage() {}
pub mod sync_storage {
use super::*;
pub fn expand(scope: &Scope) {
scope.register(Synchronization::SyncStorage)
}
}
pub fn sync_async_proxy_shared() {
unexpanded!()
}
pub mod sync_async_proxy_shared {
use super::*;
pub fn expand(scope: &Scope) {
scope.register(Synchronization::SyncAsyncProxyShared)
}
}
#[allow(unused_variables)]
pub fn workgroup_uniform_load<E: CubePrimitive>(reference: &E) -> E {
unexpanded!()
}
pub mod workgroup_uniform_load {
use super::*;
pub fn expand<E: CubePrimitive>(scope: &Scope, reference: &NativeExpand<E>) -> NativeExpand<E> {
let out = scope.create_value(E::__expand_as_type(scope));
scope.register(Instruction::new(
Operation::WorkgroupUniformLoad(reference.expand),
out,
));
out.into()
}
}
#[allow(unused_variables)]
pub fn workgroup_uniform_load_atomic<E: CubePrimitive<Scalar: Numeric>>(
reference: &Atomic<E>,
) -> E {
unexpanded!()
}
pub mod workgroup_uniform_load_atomic {
use super::*;
pub fn expand<E: CubePrimitive<Scalar: Numeric>>(
scope: &Scope,
reference: &NativeExpand<Atomic<E>>,
) -> NativeExpand<E> {
let out = scope.create_value(E::__expand_as_type(scope));
scope.register(Instruction::new(
Operation::WorkgroupUniformLoad(reference.expand),
out,
));
out.into()
}
}