Fixes output donation for IO ops on the GPU (#1857)

This commit is contained in:
Angelos Katharopoulos
2025-02-12 10:52:30 -08:00
committed by GitHub
parent 0a5215693e
commit 0145911bea
7 changed files with 92 additions and 16 deletions

View File

@@ -76,6 +76,18 @@ array::array(allocator::Buffer data, Shape shape, Dtype dtype, Deleter deleter)
set_data(data, deleter);
}
array::array(
allocator::Buffer data,
Shape shape,
Dtype dtype,
Strides strides,
size_t data_size,
Flags flags,
Deleter deleter)
: array_desc_(std::make_shared<ArrayDesc>(std::move(shape), dtype)) {
set_data(data, data_size, std::move(strides), flags, deleter);
}
void array::detach() {
for (auto& s : array_desc_->siblings) {
s.array_desc_->inputs.clear();