Skip to content
Closed
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: 2 additions & 9 deletions c10/cuda/CUDACachingAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,21 +660,14 @@ std::shared_ptr<void> getIpcDevPtr(std::string handle) {
return sp;
}

Legacy::Legacy()
: _impl(new THCCachingAllocator()) {}

Legacy::~Legacy() {
delete _impl;
}

cudaError_t
Legacy::Alloc(void** refPtr, size_t nbytes, cudaStream_t stream) {
_impl->malloc(refPtr, nbytes, stream);
caching_allocator.malloc(refPtr, nbytes, stream);
return cudaSuccess;
}

cudaError_t Legacy::Free(void* ptr) {
_impl->free(ptr);
caching_allocator.free(ptr);
return cudaSuccess;
}

Expand Down
6 changes: 0 additions & 6 deletions c10/cuda/CUDACachingAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,8 @@ struct THCCachingAllocator;

class C10_CUDA_API Legacy {
public:
Legacy();
~Legacy();

cudaError_t Alloc(void** refPtr, size_t nbytes, cudaStream_t stream);
cudaError_t Free(void* ptr);

private:
THCCachingAllocator* _impl;
};

} // namespace CUDACachingAllocator
Expand Down