def METHOD_NAME(device: int) -> float:
    memoryUse = c_uint64()
    memoryTot = c_uint64()
    ret = rocmsmi.rsmi_dev_memory_usage_get(device, 0, byref(memoryUse))
    if rocm_ret_ok(ret):
        ret = rocmsmi.rsmi_dev_memory_total_get(device, 0, byref(memoryTot))
        if rocm_ret_ok(ret):
            return float(memoryUse.value) / float(memoryTot.value)
    return 0.0