-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Implement pin_memory() as a NativeFunction #4094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@colesbury, thanks for your PR! We identified @zdevito to be a potential reviewer. |
aten/src/ATen/Allocator.h
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This adds allocators as a concept in ATen that extends deleters. An allocator is a subclass of at::Allocator that implements the virtual methods: virtual void* allocate(size_t n); virutal void deallocate(void* ptr); A tensor created with a custom allocator can be resized, unlike a tensor with a custom deleter.
54f86b5 to
d14d14d
Compare
| nullptr, | ||
| nullptr, | ||
| }; | ||
| static cudaError_t wrapped_alloc(void * ctx, void** result, size_t size, cudaStream_t stream) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| nullptr, | ||
| call_deleter, | ||
| }; | ||
| static void* wrapped_alloc(void * ctx, ptrdiff_t size) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/ATen/Allocator.h
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
32bbc76 to
cd4cdb9
Compare
cc @zdevito