mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
* redesign for faster cpu/gpu synch * load + more async CPU * use command encoder API and move more ops to use it * make fence back-end generic + CPU only fence * faster build * fix async eval * fixes + handle temporaries * fix / improve cpu conv * remove unused status, fix siblings * fix extensions * fix * fix no cpu build * format * comments * fix perf regression, remove unecessary abort * fix events, task limit cpu * fix waiting * fix donation / temporaries in normalization
30 lines
734 B
C++
30 lines
734 B
C++
// Copyright © 2023-2024 Apple Inc.
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
#include "mlx/array.h"
|
|
#include "mlx/backend/common/copy.h"
|
|
#include "mlx/backend/common/utils.h"
|
|
|
|
namespace mlx::core {
|
|
|
|
void copy(const array& src, array& dst, CopyType ctype, Stream stream);
|
|
void copy_inplace(const array& src, array& dst, CopyType ctype, Stream stream);
|
|
|
|
void copy_inplace(
|
|
const array& src,
|
|
array& dst,
|
|
const Shape& data_shape,
|
|
const Strides& i_strides,
|
|
const Strides& o_strides,
|
|
int64_t i_offset,
|
|
int64_t o_offset,
|
|
CopyType ctype,
|
|
Stream stream,
|
|
const std::optional<array>& dynamic_i_offset = std::nullopt,
|
|
const std::optional<array>& dynamic_o_offset = std::nullopt);
|
|
|
|
} // namespace mlx::core
|