def METHOD_NAME() -> gpu_runtime.GPURuntime:
    """
    Returns the GPU runtime library (CUDA / HIP) if exists. The result is cached for performance.
    """
    backend = get_gpu_backend()
    if backend == 'cuda':
        libpath = ctypes.util.find_library('cudart')
        if os.name == 'nt' and not libpath:  # Windows-based search
            for version in (12, 11, 10, 9):
                libpath = ctypes.util.find_library(f'cudart64_{version}0')
                if libpath:
                    break
    elif backend == 'hip':
        libpath = ctypes.util.find_library('amdhip64')
    else:
        raise RuntimeError(f'Cannot obtain GPU runtime library for backend {backend}')
    if not libpath:
        envname = 'PATH' if os.name == 'nt' else 'LD_LIBRARY_PATH'
        raise RuntimeError(f'GPU runtime library for {backend} not found. Please set the {envname} '
                           'environment variable to point to the libraries.')
    return gpu_runtime.GPURuntime(backend, libpath)