Skip to content

Commit

Permalink
[DeprecationWarning] Replacing soon-to-be-deprecated lazyInitCUDA w…
Browse files Browse the repository at this point in the history
…ith `lazyInitDevice(at::kCUDA)` (#7855)
  • Loading branch information
drivanov authored Jan 16, 2025
1 parent 17017c2 commit ba73133
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion graphbolt/src/cuda/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ struct CUDAWorkspaceAllocator {
// Required by thrust to satisfy allocator requirements.
using value_type = value_t;

explicit CUDAWorkspaceAllocator() { at::globalContext().lazyInitCUDA(); }
explicit CUDAWorkspaceAllocator() {
at::globalContext().lazyInitDevice(at::kCUDA);
}

template <class U>
CUDAWorkspaceAllocator(CUDAWorkspaceAllocator<U> const&) noexcept {}
Expand Down
2 changes: 1 addition & 1 deletion tensoradapter/pytorch/torch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TA_EXPORTS void CPURawDelete(void* ptr) {

#ifdef DGL_USE_CUDA
TA_EXPORTS void* CUDARawAlloc(size_t nbytes, cudaStream_t stream) {
at::globalContext().lazyInitCUDA();
at::globalContext().lazyInitDevice(at::kCUDA);
return c10::cuda::CUDACachingAllocator::raw_alloc_with_stream(nbytes, stream);
}

Expand Down

0 comments on commit ba73133

Please sign in to comment.