code: def check_compute_capabilities(compiler, settings):
      """Return compute capabilities of the installed devices."""
      global _compute_capabilities
      try:
          src = """
          #include <cuda_runtime_api.h>
          #include <stdio.h>
          #define CHECK_CUDART(x) { if ((x) != cudaSuccess) return 1; }
  
          int main() {
            int device_count;
            CHECK_CUDART(cudaGetDeviceCount(&device_count));
            for (int i = 0; i < device_count; i++) {
                cudaDeviceProp prop;
                CHECK_CUDART(cudaGetDeviceProperties(&prop, i));
                printf("%d%d ", prop.major, prop.minor);
            }
            return 0;
          }
          """
          out = build_and_run(
              compiler,
              src,
              include_dirs=settings["include_dirs"],
              libraries=("cudart",),
              library_dirs=settings["library_dirs"],
          )
          _compute_capabilities = set([int(o) for o in out.split()])
      except Exception as e:
          utils.print_warning(
              "Cannot check compute capability\n{0}".format(e)
          )
          return False
  
      return True
  
imports: import contextlib
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import List, Set
  import cupy_builder
  import cupy_builder.install_utils
  from cupy_builder import _environment
  from cupy_builder._context import Context
label_desc: Use image node_id 12 for calling a global function with example usage: check_compute_capabilities(compiler, settings) and returns: True, False