Skip to content

Commit ba73133

Browse files
authored
[DeprecationWarning] Replacing soon-to-be-deprecated lazyInitCUDA with lazyInitDevice(at::kCUDA) (dmlc#7855)
1 parent 17017c2 commit ba73133

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

graphbolt/src/cuda/common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ struct CUDAWorkspaceAllocator {
5858
// Required by thrust to satisfy allocator requirements.
5959
using value_type = value_t;
6060

61-
explicit CUDAWorkspaceAllocator() { at::globalContext().lazyInitCUDA(); }
61+
explicit CUDAWorkspaceAllocator() {
62+
at::globalContext().lazyInitDevice(at::kCUDA);
63+
}
6264

6365
template <class U>
6466
CUDAWorkspaceAllocator(CUDAWorkspaceAllocator<U> const&) noexcept {}

tensoradapter/pytorch/torch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TA_EXPORTS void CPURawDelete(void* ptr) {
2828

2929
#ifdef DGL_USE_CUDA
3030
TA_EXPORTS void* CUDARawAlloc(size_t nbytes, cudaStream_t stream) {
31-
at::globalContext().lazyInitCUDA();
31+
at::globalContext().lazyInitDevice(at::kCUDA);
3232
return c10::cuda::CUDACachingAllocator::raw_alloc_with_stream(nbytes, stream);
3333
}
3434

0 commit comments

Comments
 (0)