MLX
 
Loading...
Searching...
No Matches
copy.h
Go to the documentation of this file.
1// Copyright © 2023-2024 Apple Inc.
2
3#pragma once
4
5#include "mlx/array.h"
7
8namespace mlx::core {
9
10enum class CopyType {
11 // Copy a raw scalar input into the full contiguous output
13
14 // Copy the raw input buffer contiguously into a raw output buffer of the same
15 // size
17
18 // Copy the full virtual input to the full contiguous output
20
21 // Copy the full virtual input to the full virtual output. We assume the
22 // input and output have the same shape.
24};
25
26void copy(const array& src, array& dst, CopyType ctype);
27void copy_inplace(const array& src, array& dst, CopyType ctype);
28
30 const array& src,
31 array& dst,
32 const Shape& data_shape,
33 const Strides& i_strides,
34 const Strides& o_strides,
35 int64_t i_offset,
36 int64_t o_offset,
37 CopyType ctype);
38
39} // namespace mlx::core
Definition array.h:24
Definition allocator.h:7
void copy(const array &src, array &dst, CopyType ctype)
std::vector< ShapeElem > Shape
Definition array.h:21
std::vector< int64_t > Strides
Definition array.h:22
void copy_inplace(const array &src, array &dst, CopyType ctype)
CopyType
Definition copy.h:10
@ General
Definition copy.h:19
@ Vector
Definition copy.h:16
@ GeneralGeneral
Definition copy.h:23
@ Scalar
Definition copy.h:12