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
6#include "mlx/stream.h"
7
8namespace mlx::core {
9
10// Generic copy inplace
11template <typename stride_t>
13 const array& in,
14 array& out,
15 const std::vector<int>& data_shape,
16 const std::vector<stride_t>& i_strides,
17 const std::vector<stride_t>& o_strides,
18 int64_t i_offset,
19 int64_t o_offset,
20 CopyType ctype,
21 const Stream& s);
22
23void copy_gpu(const array& src, array& out, CopyType ctype, const Stream& s);
24void copy_gpu(const array& src, array& out, CopyType ctype);
25
27 const array& src,
28 array& out,
29 CopyType ctype,
30 const Stream& s);
31
33 const array& in,
34 array& out,
35 const std::vector<int64_t>& istride,
36 int64_t ioffset,
37 CopyType ctype,
38 const Stream& s);
39
40} // namespace mlx::core
Definition array.h:20
Definition allocator.h:7
void copy_gpu_inplace(const array &in, array &out, const std::vector< int > &data_shape, const std::vector< stride_t > &i_strides, const std::vector< stride_t > &o_strides, int64_t i_offset, int64_t o_offset, CopyType ctype, const Stream &s)
CopyType
Definition copy.h:10
void copy_gpu(const array &src, array &out, CopyType ctype, const Stream &s)
Definition stream.h:9