MCPcopy Create free account
hub / github.com/ml-explore/mlx / copy_shared_buffer

Method copy_shared_buffer

mlx/array.cpp:191–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void array::copy_shared_buffer(
192 const array& other,
193 const Strides& strides,
194 Flags flags,
195 size_t data_size,
196 int64_t offset /* = 0 */) {
197 array_desc_->data = other.array_desc_->data;
198 array_desc_->strides = strides;
199 array_desc_->flags = flags;
200 array_desc_->data_size = data_size;
201 array_desc_->offset =
202 sizeof(char) * itemsize() * offset + other.array_desc_->offset;
203}
204
205void array::copy_shared_buffer(const array& other) {
206 copy_shared_buffer(other, other.strides(), other.flags(), other.data_size());

Callers 15

pad_gpuFunction · 0.80
eval_gpuMethod · 0.80
transpose_in_evalFunction · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
compute_dynamic_offsetFunction · 0.80
eval_cpuMethod · 0.80

Calls 1

itemsizeFunction · 0.85

Tested by

no test coverage detected