cubecl_core/frontend/operation/
copy.rs1use crate::prelude::*;
2
3pub fn copy_bulk<C: CubePrimitive>(
18 _from: &Slice<C>,
19 _from_index: u32,
20 _to: &mut SliceMut<C>,
21 _to_index: u32,
22 _length: u32,
23) {
24}
25
26pub mod copy_bulk {
27 use crate::ir::{CopyMemoryBulkOperator, Instruction, Operator, Scope};
28
29 use super::*;
30
31 pub fn expand<C: CubePrimitive>(
33 scope: &mut Scope,
34 from: SliceExpand<C, ReadOnly>,
35 from_index: ExpandElementTyped<u32>,
36 to: SliceExpand<C, ReadWrite>,
37 to_index: ExpandElementTyped<u32>,
38 length: u32,
39 ) {
40 let (input, input_offset) = from.__to_raw_parts();
41 let (to, to_offset) = to.__to_raw_parts();
42
43 scope.register(Instruction::new(
44 Operator::CopyMemoryBulk(CopyMemoryBulkOperator {
45 out_index: to_index.expand.consume(),
46 input,
47 in_index: from_index.expand.consume(),
48 len: length.into(),
49 offset_input: input_offset,
50 offset_out: to_offset,
51 }),
52 to,
53 ));
54 }
55}