File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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 {}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ TA_EXPORTS void CPURawDelete(void* ptr) {
2828
2929#ifdef DGL_USE_CUDA
3030TA_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
You can’t perform that action at this time.
0 commit comments