Skip to content

Commit 16999f9

Browse files
author
Protonu Basu
committed
use nullptr to address clang-tidy
1 parent ec76834 commit 16999f9

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
@@ -940,7 +940,7 @@ void CudaCodeGen::call(const std::vector<CallArg>& args) {
940940
void CudaCodeGen::CompileToNVRTC(
941941
const std::string& code,
942942
const std::string& func_name) {
943-
CUcontext pctx = nullptr;
943+
CUcontext pctx = 0;
944944
AT_CUDA_DRIVER_CHECK(nvrtc().cuCtxGetCurrent(&pctx));
945945
// Note: hacked at::DeviceGuard since at::DeviceGuard was failing to work
946946
// properly in some scenarios
@@ -953,7 +953,7 @@ void CudaCodeGen::CompileToNVRTC(
953953
if (!pctx) {
954954
std::unique_lock<std::mutex> cudaFreeMutexLock(
955955
*(c10::cuda::CUDACachingAllocator::getFreeMutex()));
956-
cudaFree(0);
956+
cudaFree(nullptr);
957957
AT_CUDA_DRIVER_CHECK(nvrtc().cuCtxGetCurrent(&pctx));
958958
}
959959
// Acquires device and NVRTC properties (for compile arch and occupancy

0 commit comments

Comments
 (0)