cubecl-cpp 0.11.0-pre.4

CPP transpiler for CubeCL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use cubecl_core::ir::{dialect::atomic::*, prelude::*};

use crate::hip::hip_op_with_out;

hip_op_with_out!(AtomicIAddOp, |op, ctx| {
    let ptr = op.ptr(ctx).name(ctx);
    let value = op.value(ctx).name(ctx);
    format!("atomicAdd({ptr}, {value})")
});

hip_op_with_out!(AtomicFAddOp, |op, ctx| {
    let ptr = op.ptr(ctx).name(ctx);
    let value = op.value(ctx).name(ctx);
    format!("atomicAdd({ptr}, {value})")
});