diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py index 181699e4619b7992fcf28f11c7cafcdf814a48c7..2b659bdedd38b16372434078fae08e356f46afa1 100644 --- a/pyopencl/cffi_cl.py +++ b/pyopencl/cffi_cl.py @@ -625,10 +625,9 @@ def _parse_context_properties(properties): 'CGL_SHAREGROUP_KHR', )]: - import ctypes - if isinstance(value, ctypes._Pointer): - import struct - val, = struct.unpack("P", bytes(memoryview(value))) + from ctypes import _Pointer, addressof + if isinstance(value, _Pointer): + val = addressof(value) else: val = int(value)