-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static method of _Memory to create from external allocation
Method takes USMRef, number of bytes and queue reference. If USMRef is bound to context in the queue and USM type comes back not 'unknown', appropriate MemoryUSM* object is created which assumes ownership of this memory. Optional `memory_owner` keyword argument may be specified to set the recorded reference object to something other than None (signaling that _Memory is responsible for memory deallocation). This can be used to create MemoryUSM* Python object from natively allocated memory, populate it, but leave deallocation to the caller. It could also be set to a PyCapsule object that carries a custom deleter.
- Loading branch information
1 parent
5a60bd0
commit 8fed78b
Showing
2 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters