def ndarray_device_allocate_data(ary):
 datasize = driver.host_memory_size(ary)
 gpu_data = devices.get_context().memalloc(datasize)
 return gpu_data

def ndarray_device_allocate_data ( ary ) : datasize = driver . host_memory_size ( ary ) gpu_data = devices . get_context ( ) . memalloc ( datasize ) return gpu_data
allocate gpu data buffer .