@require_context
def mapped_array(shape, dtype=np.float, strides=None, order='C', stream=0, portable=False, wc=False):
 (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, mapped=True)
 npary = np.ndarray(shape=shape, strides=strides, dtype=dtype, order=order, buffer=buffer)
 mappedview = np.ndarray.view(npary, type=devicearray.MappedNDArray)
 mappedview.device_setup(buffer, stream=stream)
 return mappedview

@ require_context def mapped_array ( shape , dtype = np . float , strides = None , order = 'C' , stream = 0 , portable = False , wc = False ) : ( 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 , mapped = True ) npary = np . ndarray ( shape = shape , strides = strides , dtype = dtype , order = order , buffer = buffer ) mappedview = np . ndarray . view ( npary , type = devicearray . MappedNDArray ) mappedview . device_setup ( buffer , stream = stream ) return mappedview
mapped_array allocate a mapped ndarray with a buffer that is pinned and mapped on to the device .