@@ -34,10 +34,10 @@ Status check_driver_version(const DriverApi* driver, int minimum_version) {
3434PyObject* get_max_grid_size (PyObject *self, PyObject *args) {
3535 int device_id;
3636 if (!PyArg_ParseTuple (args, " i" , &device_id))
37- return NULL ;
37+ return nullptr ;
3838
3939 Result<const DriverApi*> driver = get_driver_api ();
40- if (!driver.is_ok ()) return NULL ;
40+ if (!driver.is_ok ()) return nullptr ;
4141
4242 CUdevice dev;
4343 CUresult res = (*driver)->cuDeviceGet (&dev, device_id);
@@ -62,7 +62,7 @@ PyObject* get_compute_capability(PyObject *self, PyObject *Py_UNUSED(ignored)) {
6262 CUdevice dev;
6363
6464 Result<const DriverApi*> driver_result = get_driver_api ();
65- if (!driver_result.is_ok ()) return NULL ;
65+ if (!driver_result.is_ok ()) return nullptr ;
6666 const DriverApi* d = *driver_result;
6767
6868 CUresult res = d->cuDeviceGet (&dev, 0 );
@@ -84,7 +84,7 @@ PyObject* get_driver_version(PyObject *self, PyObject *Py_UNUSED(ignored)) {
8484 int major, minor;
8585
8686 Result<const DriverApi*> driver_result = get_driver_api ();
87- if (!driver_result.is_ok ()) return NULL ;
87+ if (!driver_result.is_ok ()) return nullptr ;
8888 const DriverApi* d = *driver_result;
8989
9090 CUresult res = d->cuDriverGetVersion (&major);
@@ -100,7 +100,7 @@ PyObject* get_driver_version(PyObject *self, PyObject *Py_UNUSED(ignored)) {
100100
101101PyObject* synchronize_context (PyObject* self, PyObject* Py_UNUSED (ignored)) {
102102 Result<const DriverApi*> driver_result = get_driver_api ();
103- if (!driver_result.is_ok ()) return NULL ;
103+ if (!driver_result.is_ok ()) return nullptr ;
104104 const DriverApi* d = *driver_result;
105105
106106 CUresult res = d->cuCtxSynchronize ();
@@ -115,7 +115,7 @@ PyObject* synchronize_context(PyObject* self, PyObject* Py_UNUSED(ignored)) {
115115
116116PyObject* create_stream (PyObject* self, PyObject* Py_UNUSED (ignored)) {
117117 Result<const DriverApi*> driver_result = get_driver_api ();
118- if (!driver_result.is_ok ()) return NULL ;
118+ if (!driver_result.is_ok ()) return nullptr ;
119119 const DriverApi* d = *driver_result;
120120
121121 CUstream stream;
@@ -129,10 +129,10 @@ PyObject* create_stream(PyObject* self, PyObject* Py_UNUSED(ignored)) {
129129
130130PyObject* destroy_stream (PyObject* self, PyObject* arg) {
131131 CUstream stream = static_cast <CUstream>(PyLong_AsVoidPtr (arg));
132- if (PyErr_Occurred ()) return NULL ;
132+ if (PyErr_Occurred ()) return nullptr ;
133133
134134 Result<const DriverApi*> driver_result = get_driver_api ();
135- if (!driver_result.is_ok ()) return NULL ;
135+ if (!driver_result.is_ok ()) return nullptr ;
136136 const DriverApi* d = *driver_result;
137137
138138 CUresult res = d->cuStreamDestroy (stream);
@@ -217,7 +217,7 @@ static PyMethodDef functions[] = {
217217 " Destroy a CUDA stream given its int handle." },
218218 {" _spy_on_cuLaunchKernel_begin" , spy_on_cuLaunchKernel_begin, METH_O , nullptr },
219219 {" _spy_on_cuLaunchKernel_end" , spy_on_cuLaunchKernel_end, METH_NOARGS , nullptr },
220- NULL
220+ {}
221221};
222222
223223Status cuda_helper_init (PyObject* m) {
0 commit comments