Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions backends/aoti/slim/core/Storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,17 @@ class MaybeOwningStorage {
}
}

/// Constructs non-owning storage with external memory.
/// @param device The device where the data resides.
/// @param data Pointer to external memory (not owned by this storage).
/// @param nbytes Size of the external memory in bytes.
MaybeOwningStorage(const c10::Device& device, void* data, size_t nbytes)
: device_(device),
data_(data),
capacity_(nbytes),
deleter_(detail::noop),
is_owning_(false) {}

/// Default constructor is deleted - storage must have a device.
MaybeOwningStorage() = delete;

Expand Down
Loading
Loading