mirror of
https://github.com/dmlc/dgl.git
synced 2026-06-04 19:44:23 +08:00
[DeprecationWarning] Replacing soon-to-be-deprecated lazyInitCUDA with lazyInitDevice(at::kCUDA) (#7855)
This commit is contained in:
@@ -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 {}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user