code: def make_cuda_ext(name, module, sources, sources_cuda=[]):
      define_macros = []
      extra_compile_args = {"cxx": []}
  
      if (
          torch.cuda.is_available()
          or os.getenv("FORCE_CUDA", "0") == "1"
      ):
          define_macros += [("WITH_CUDA", None)]
          extension = CUDAExtension
          extra_compile_args["nvcc"] = [
              "-D__CUDA_NO_HALF_OPERATORS__",
              "-D__CUDA_NO_HALF_CONVERSIONS__",
              "-D__CUDA_NO_HALF2_OPERATORS__",
          ]
          sources += sources_cuda
      else:
          print(f"Compiling {name} without CUDA")
          extension = CppExtension
  
      return extension(
          name=f"{module}.{name}",
          sources=[
              os.path.join(*module.split("."), p) for p in sources
          ],
          define_macros=define_macros,
          extra_compile_args=extra_compile_args,
      )
  
file_path: mmdetection/setup.py
imports: import os
  import os.path
  import platform
  import shutil
  import sys
  import warnings
  from setuptools import find_packages, setup
  import torch
  from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension
label_desc: Use image node_id 3 for calling a global function with example usage: make_cuda_ext(name, module, sources, sources_cuda) and returns: extension