Skip to content

Commit 85c357c

Browse files
author
Protonu Basu
committed
use nullptr to address clang-tidy
1 parent cb4069d commit 85c357c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/csrc/jit/tensorexpr/cuda_codegen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ void CudaCodeGen::call(const std::vector<CallArg>& args) {
934934
void CudaCodeGen::CompileToNVRTC(
935935
const std::string& code,
936936
const std::string& func_name) {
937-
CUcontext pctx = nullptr;
937+
CUcontext pctx = 0;
938938
AT_CUDA_DRIVER_CHECK(nvrtc().cuCtxGetCurrent(&pctx));
939939
// Note: hacked at::DeviceGuard since at::DeviceGuard was failing to work
940940
// properly in some scenarios
@@ -947,7 +947,7 @@ void CudaCodeGen::CompileToNVRTC(
947947
if (!pctx) {
948948
std::unique_lock<std::mutex> cudaFreeMutexLock(
949949
*(c10::cuda::CUDACachingAllocator::getFreeMutex()));
950-
cudaFree(0);
950+
cudaFree(nullptr);
951951
AT_CUDA_DRIVER_CHECK(nvrtc().cuCtxGetCurrent(&pctx));
952952
}
953953
// Acquires device and NVRTC properties (for compile arch and occupancy

0 commit comments

Comments
 (0)