code: def find_libdevice_path(arch):
      """Utility function to find libdevice
  
      Parameters
      ----------
      arch : int
          The compute architecture in int
  
      Returns
      -------
      path : str
          Path to libdevice.
      """
      cuda_path = find_cuda_path()
      lib_path = os.path.join(cuda_path, "nvvm/libdevice")
      if not os.path.exists(lib_path):
          # Debian/Ubuntu repackaged CUDA path
          lib_path = os.path.join(
              cuda_path, "lib/nvidia-cuda-toolkit/libdevice"
          )
      selected_ver = 0
      selected_path = None
      cuda_ver = get_cuda_version(cuda_path)
      major_minor = (cuda_ver[0], cuda_ver[1])
      if major_minor in (
          (9, 0),
          (9, 1),
          (10, 0),
          (10, 1),
          (10, 2),
          (11, 0),
          (11, 1),
          (11, 2),
          (11, 3),
      ):
          path = os.path.join(lib_path, "libdevice.10.bc")
      else:
          for fn in os.listdir(lib_path):
              if not fn.startswith("libdevice"):
                  continue
  
              try:
                  # expected pattern: libdevice.${ARCH}.10.bc
                  #             e.g., libdevice.compute_20.10.bc
                  ver = int(fn.split(".")[-3].split("_")[-1])
                  if selected_ver < ver <= arch:
                      selected_ver = ver
                      selected_path = fn
              except ValueError:
                  # it can just be `libdevice.10.bc` in CUDA 10
                  selected_path = fn
  
          if selected_path is None:
              raise RuntimeError(
                  f"Cannot find libdevice for arch {arch}"
              )
          path = os.path.join(lib_path, selected_path)
      return path
  
imports: from __future__ import absolute_import
  import os
  import subprocess
  import warnings
  import tvm._ffi
  from tvm.target import Target
  from .._ffi.base import py_str
  from .None import utils
label_desc: Use image node_id 5 for calling a global function with example usage: find_libdevice_path(arch) and returns: path