@require_context
def pinned_array(shape, dtype=np.float, strides=None, order='C'):
 (shape, strides, dtype) = _prepare_shape_strides_dtype(shape, strides, dtype, order)
 bytesize = driver.memory_size_from_info(shape, strides, dtype.itemsize)
 buffer = current_context().memhostalloc(bytesize)
 return np.ndarray(shape=shape, strides=strides, dtype=dtype, order=order, buffer=buffer)

@ require_context def pinned_array ( shape , dtype = np . float , strides = None , order = 'C' ) : ( shape , strides , dtype ) = _prepare_shape_strides_dtype ( shape , strides , dtype , order ) bytesize = driver . memory_size_from_info ( shape , strides , dtype . itemsize ) buffer = current_context ( ) . memhostalloc ( bytesize ) return np . ndarray ( shape = shape , strides = strides , dtype = dtype , order = order , buffer = buffer )
pinned_array allocate a np .