#NEWLINE# @ trace #NEWLINE# def _allocate( self , where , obj = None , dtype = None , shape = None , strides = None , copy = True ) : #NEWLINE# #INDENT# if dtype : #NEWLINE# #INDENT# dtype = numpy . dtype ( dtype ) #NEWLINE# #UNINDENT# if ( where == 'host' ) : #NEWLINE# #INDENT# if ( obj is not None ) : #NEWLINE# #INDENT# self . _host = numpy . array ( obj , self , copy = copy ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _host = numpy . empty ( shape , dtype , _s2o ( dtype , shape , strides ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# from numba.cuda.cudadrv import devicearray as da #NEWLINE# if ( obj is not None ) : #NEWLINE# #INDENT# if ( not isinstance ( obj , numpy . ndarray ) ) : #NEWLINE# #INDENT# obj = numpy . array ( obj , copy = False ) #NEWLINE# #UNINDENT# self . _gpu = da . from_array_like ( obj ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( strides is None ) : #NEWLINE# #INDENT# strides = _o2s ( dtype , shape , 'C' ) #NEWLINE# #UNINDENT# self . _gpu = da . DeviceNDArray ( shape , strides , dtype )