MLX
Loading...
Searching...
No Matches
mlx
backend
metal
copy.h
Go to the documentation of this file.
1
// Copyright © 2023-2024 Apple Inc.
2
3
#pragma once
4
5
#include "
mlx/backend/common/copy.h
"
6
#include "
mlx/stream.h
"
7
8
namespace
mlx::core
{
9
10
// Generic copy inplace
11
template
<
typename
str
id
e_t>
12
void
copy_gpu_inplace
(
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
23
void
copy_gpu
(
const
array
& src,
array
& out,
CopyType
ctype,
const
Stream
& s);
24
void
copy_gpu
(
const
array
& src,
array
& out,
CopyType
ctype);
25
26
void
copy_gpu_inplace
(
27
const
array
& src,
28
array
& out,
29
CopyType
ctype,
30
const
Stream
& s);
31
32
void
copy_gpu_inplace
(
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
mlx::core::array
Definition
array.h:20
copy.h
mlx::core
Definition
allocator.h:7
mlx::core::copy_gpu_inplace
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)
mlx::core::CopyType
CopyType
Definition
copy.h:10
mlx::core::copy_gpu
void copy_gpu(const array &src, array &out, CopyType ctype, const Stream &s)
stream.h
mlx::core::Stream
Definition
stream.h:9
Generated by
1.10.0