def get_ptr_ctypes2(x):
    return x.ctypes._data

def get_ptr_array(x):
    return x.__array_interface__['data'][0]
try:
    from accel import _get_ptr as get_ptr
except ImportError:
    get_ptr = get_ptr_array
Portable/fast way to obtain a pointer to Numpy/Numpypy data