cubecl_core/frontend/operation/
copy_op.rs1use crate::prelude::*;
2
3pub fn copy_bulk<C: CubePrimitive>(_from: &[C], _to: &mut [C], _length: usize) {}
16
17pub mod copy_bulk {
18 use cubecl_ir::dialect::memory::CopyOp;
19
20 use crate::ir::Scope;
21
22 use super::*;
23
24 pub fn expand<C: CubePrimitive>(
26 scope: &Scope,
27 from: &SliceExpand<C>,
28 to: &mut SliceExpand<C>,
29 length: usize,
30 ) {
31 let source = unsafe { *from.__expand_as_ptr_method(scope) }.value(scope);
32 let target = unsafe { *to.__expand_as_mut_ptr_method(scope) }.value(scope);
33
34 scope.register(&CopyOp::new(scope.ctx_mut(), source, target, length));
35 }
36}
37
38pub fn copy<C: CubePrimitive>(_from: &C, _to: &mut C) {}
51
52pub mod copy {
53 use cubecl_ir::dialect::memory::CopyOp;
54
55 use crate::ir::Scope;
56
57 use super::*;
58
59 pub fn expand<C: CubePrimitive>(
61 scope: &Scope,
62 from: &NativeExpand<C>,
63 to: &mut NativeExpand<C>,
64 ) {
65 let source = from.value(scope);
66 let target = to.value(scope);
67
68 scope.register(&CopyOp::new(scope.ctx_mut(), source, target, 1));
69 }
70}