def device_memory_size(devmem):
 sz = getattr(devmem, '_cuda_memsize_', None)
 if (sz is None):
  (s, e) = device_extents(devmem)
  sz = (e - s)
  devmem._cuda_memsize_ = sz
 assert (sz > 0), 'zero length array'
 return sz

def device_memory_size ( devmem ) : sz = getattr ( devmem , '_cuda_memsize_' , None ) if ( sz is None ) : ( s , e ) = device_extents ( devmem ) sz = ( e - s ) devmem . _cuda_memsize_ = sz assert ( sz > 0 ) , 'zero length array' return sz
check the memory size of the device memory .