diff --git a/src/storage/gpu_device_storage.h b/src/storage/gpu_device_storage.h index 562badb8752e..86758c0762fa 100644 --- a/src/storage/gpu_device_storage.h +++ b/src/storage/gpu_device_storage.h @@ -55,9 +55,9 @@ class GPUDeviceStorage { }; // class GPUDeviceStorage inline void* GPUDeviceStorage::Alloc(Storage::Handle* handle) { - const size_t size = handle->size; void* ret = nullptr; #if MXNET_USE_CUDA + const size_t size = handle->size; mxnet::common::cuda::DeviceStore device_store(handle->ctx.real_dev_id(), true); #if MXNET_USE_NCCL std::lock_guard l(Storage::Get()->GetMutex(Context::kGPU));