code: def get_features(ctx: Context) -> Dict[str, Feature]:
      # We handle nvtx (and likely any other future support) here, because
      # the HIP stubs (hip/cupy_*.h) would cause many symbols
      # to leak into all these modules even if unused. It's easier for all of
      # them to link to the same set of shared libraries.
      HIP_cuda_nvtx_cusolver = {
          # TODO(leofang): call this "rocm" or "hip" to avoid confusion?
          "name": "cuda",
          "required": True,
          "file": _cuda_files
          + [
              "cupy_backends.cuda.libs.nvtx",
              "cupy_backends.cuda.libs.cusolver",
              "cupyx.cusolver",
          ],
          "include": [
              "hip/hip_runtime_api.h",
              "hip/hiprtc.h",
              "hipblas.h",
              "hiprand/hiprand.h",
              "hipsparse.h",
              "hipfft.h",
              "roctx.h",
              "rocsolver.h",
          ],
          "libraries": [
              "amdhip64",  # was hiprtc and hip_hcc before ROCm 3.8.0
              "hipblas",
              ("hipfft", lambda hip_version: hip_version >= 401),
              "hiprand",
              "hipsparse",
              "rocfft",
              "roctx64",
              "rocblas",
              "rocsolver",
              "rocsparse",
          ],
          "check_method": build.check_hip_version,
          "version_method": build.get_hip_version,
      }
      CUDA_cusolver = {
          "name": "cusolver",
          "required": True,
          "file": [
              "cupy_backends.cuda.libs.cusolver",
              "cupyx.cusolver",
          ],
          "include": [
              "cusolverDn.h",
          ],
          "libraries": [
              "cusolver",
          ],
      }
      CUDA_cudnn = {
          "name": "cudnn",
          "file": [
              "cupy_backends.cuda.libs.cudnn",
              "cupyx.cudnn",
          ],
          "include": [
              "cudnn.h",
          ],
          "libraries": [
              "cudnn",
          ],
          "check_method": build.check_cudnn_version,
          "version_method": build.get_cudnn_version,
      }
      CUDA_nccl = {
          "name": "nccl",
          "file": [
              "cupy_backends.cuda.libs.nccl",
          ],
          "include": [
              "nccl.h",
          ],
          "libraries": [
              "nccl",
          ],
          "check_method": build.check_nccl_version,
          "version_method": build.get_nccl_version,
      }
      CUDA_nvtx = {
          "name": "nvtx",
          "file": [
              "cupy_backends.cuda.libs.nvtx",
          ],
          "include": [
              "nvtx3/nvToolsExt.h",
          ],
          "libraries": [],
          "check_method": build.check_nvtx,
      }
      CUDA_cutensor = {
          "name": "cutensor",
          "file": [
              "cupy_backends.cuda.libs.cutensor",
              "cupyx.cutensor",
          ],
          "include": [
              "cutensor.h",
          ],
          "libraries": [
              "cutensor",
              "cublas",
          ],
          "check_method": build.check_cutensor_version,
          "version_method": build.get_cutensor_version,
      }
      CUDA_cub = {
          "name": "cub",
          "required": True,
          "file": [
              ("cupy.cuda.cub", ["cupy/cuda/cupy_cub.cu"]),
          ],
          "include": [
              "cub/util_namespace.cuh",  # dummy
          ],
          "libraries": list(_cudart_static_libs),
          "static_libraries": [
              # Dependency from CUB header files
              "cudart_static",
          ],
          "check_method": build.check_cub_version,
          "version_method": build.get_cub_version,
      }
      CUDA_jitify = {
          "name": "jitify",
          "required": True,
          "file": [
              "cupy.cuda.jitify",
          ],
          "include": [
              "cuda.h",
              "cuda_runtime.h",
              "nvrtc.h",
          ],
          "libraries": [
              # Dependency from Jitify header files
              "cuda",
              "nvrtc",
          ]
          + _cudart_static_libs,
          "static_libraries": [
              # Dependency from Jitify header files
              "cudart_static",
          ],
          "check_method": build.check_jitify_version,
          "version_method": build.get_jitify_version,
      }
      CUDA_random = {
          "name": "random",
          "required": True,
          "file": [
              "cupy.random._bit_generator",
              (
                  "cupy.random._generator_api",
                  ["cupy/random/cupy_distributions.cu"],
              ),
          ],
          "include": [],
          "libraries": [
              "curand",
          ]
          + _cudart_static_libs,
          "static_libraries": [
              "cudart_static",
          ],
      }
      HIP_random = {
          "name": "random",
          "required": True,
          "file": [
              "cupy.random._bit_generator",
              (
                  "cupy.random._generator_api",
                  ["cupy/random/cupy_distributions.cu"],
              ),
          ],
          "include": [
              "hiprand/hiprand.h",
          ],
          "libraries": [
              # Dependency from cuRAND header files
              "amdhip64",  # was hiprtc and hip_hcc before ROCm 3.8.0
              "hiprand",
          ],
          "check_method": build.check_hip_version,
          "version_method": build.get_hip_version,
      }
      CUDA_cusparselt = {
          "name": "cusparselt",
          "file": [
              "cupy_backends.cuda.libs.cusparselt",
          ],
          "include": [
              "cusparseLt.h",
          ],
          "libraries": [
              "cusparseLt",
          ],
          "check_method": build.check_cusparselt_version,
          "version_method": build.get_cusparselt_version,
      }
      HIP_cub = {
          "name": "cub",
          "required": True,
          "file": [
              ("cupy.cuda.cub", ["cupy/cuda/cupy_cub.cu"]),
          ],
          "include": [
              "hipcub/hipcub_version.hpp",  # dummy
          ],
          "libraries": [
              "amdhip64",  # was hiprtc and hip_hcc before ROCm 3.8.0
          ],
          "check_method": build.check_cub_version,
          "version_method": build.get_cub_version,
      }
      HIP_nccl = {
          "name": "nccl",
          "file": [
              "cupy_backends.cuda.libs.nccl",
          ],
          "include": [
              "rccl.h",
          ],
          "libraries": [
              "rccl",
          ],
          "check_method": build.check_nccl_version,
          "version_method": build.get_nccl_version,
      }
      HIP_thrust = {
          "name": "thrust",
          "required": True,
          "file": [
              ("cupy.cuda.thrust", ["cupy/cuda/cupy_thrust.cu"]),
          ],
          "include": [
              "thrust/version.h",
          ],
          "libraries": [
              "amdhip64",  # was hiprtc and hip_hcc before ROCm 3.8.0
          ],
      }
      CUDA_thrust = {
          "name": "thrust",
          "required": True,
          "file": [
              ("cupy.cuda.thrust", ["cupy/cuda/cupy_thrust.cu"]),
          ],
          "include": [
              "thrust/device_ptr.h",
              "thrust/sequence.h",
              "thrust/sort.h",
          ],
          "libraries": list(_cudart_static_libs),
          "static_libraries": [
              # Dependency from Thrust header files
              "cudart_static",
          ],
          "check_method": build.check_thrust_version,
          "version_method": build.get_thrust_version,
      }
      COMMON_dlpack = {
          "name": "dlpack",
          "required": True,
          "file": [
              "cupy._core.dlpack",
          ],
          "include": [
              "cupy/_dlpack/dlpack.h",
          ],
          "libraries": [],
      }
  
      if ctx.use_hip:
          features = [
              _from_dict(HIP_cuda_nvtx_cusolver, ctx),
              _from_dict(HIP_cub, ctx),
              _from_dict(HIP_nccl, ctx),
              _from_dict(HIP_random, ctx),
              _from_dict(HIP_thrust, ctx),
              _from_dict(COMMON_dlpack, ctx),
          ]
      else:
          features = [
              CUDA_cuda(ctx),
              _from_dict(CUDA_cusolver, ctx),
              _from_dict(CUDA_cudnn, ctx),
              _from_dict(CUDA_nccl, ctx),
              _from_dict(CUDA_nvtx, ctx),
              _from_dict(CUDA_cutensor, ctx),
              _from_dict(CUDA_cub, ctx),
              _from_dict(CUDA_jitify, ctx),
              _from_dict(CUDA_random, ctx),
              _from_dict(CUDA_thrust, ctx),
              _from_dict(CUDA_cusparselt, ctx),
              _from_dict(COMMON_dlpack, ctx),
          ]
      return {f.name: f for f in features}
  
file_path: cupy/install/cupy_builder/_features.py
imports: import sys
  from typing import Any, Dict, List
  import cupy_builder.install_build
  import cupy_builder.install_utils
  from cupy_builder import Context
label_desc: Use image node_id 2 for calling a global function with example usage: get_features(ctx) and returns: unknown