mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Allow querying the allocator for the buffer size (#1404)
This commit is contained in:
committed by
GitHub
parent
8b30acd7eb
commit
881f09b2e2
@@ -324,6 +324,10 @@ class array {
|
||||
return array_desc_->data->buffer;
|
||||
}
|
||||
|
||||
size_t buffer_size() const {
|
||||
return allocator::allocator().size(buffer());
|
||||
}
|
||||
|
||||
// Return a copy of the shared pointer
|
||||
// to the array::Data struct
|
||||
std::shared_ptr<Data> data_shared_ptr() const {
|
||||
|
||||
Reference in New Issue
Block a user