diff --git a/src/wrapper/wrap_cl.hpp b/src/wrapper/wrap_cl.hpp index 5be798539bf7b7c7076e80f84f28e2cb9554be21..42caacf8e7437c26f278dd89d69563ff303ef020 100644 --- a/src/wrapper/wrap_cl.hpp +++ b/src/wrapper/wrap_cl.hpp @@ -1324,7 +1324,11 @@ namespace pyopencl PYOPENCL_CALL_GUARDED(clGetMemObjectInfo, (data(), CL_MEM_SIZE, sizeof(my_length), &my_length, 0)); +#if PY_VERSION_HEX >= 0x03020000 + if (PySlice_GetIndicesEx(slc.ptr(), +#else if (PySlice_GetIndicesEx(reinterpret_cast(slc.ptr()), +#endif my_length, &start, &end, &stride, &length) != 0) throw py::error_already_set();