diff --git a/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp b/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp index 1dd52bf0db..f5bee11170 100644 --- a/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp +++ b/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp @@ -20,7 +20,7 @@ double elapsed() { struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); return tv.tv_sec + tv.tv_usec * 1e-6; } diff --git a/faiss/gpu/utils/Timer.cpp b/faiss/gpu/utils/Timer.cpp index 0d75b64fc7..f543a08007 100644 --- a/faiss/gpu/utils/Timer.cpp +++ b/faiss/gpu/utils/Timer.cpp @@ -14,7 +14,10 @@ namespace faiss { namespace gpu { KernelTimer::KernelTimer(cudaStream_t stream) - : startEvent_(0), stopEvent_(0), stream_(stream), valid_(true) { + : startEvent_(nullptr), + stopEvent_(nullptr), + stream_(stream), + valid_(true) { CUDA_VERIFY(cudaEventCreate(&startEvent_)); CUDA_VERIFY(cudaEventCreate(&stopEvent_)); diff --git a/faiss/gpu/utils/Timer.h b/faiss/gpu/utils/Timer.h index 7abfa4c903..aa5d65038e 100644 --- a/faiss/gpu/utils/Timer.h +++ b/faiss/gpu/utils/Timer.h @@ -18,7 +18,7 @@ class KernelTimer { public: /// Constructor starts the timer and adds an event into the current /// device stream - KernelTimer(cudaStream_t stream = 0); + KernelTimer(cudaStream_t stream = nullptr); /// Destructor releases event resources ~KernelTimer();