def host_memory_size(obj):
    "Get the size of the memory"
    s, e = host_memory_extents(obj)
    assert e >= s, "memory extend of negative size"
    return e - s
Get the size of the memory
numba/cuda/cudadrv/driver.py