class_docstr: Custom `build_ext` command to include CUDA C source files.
class_docstr_tok: ["Custom","`","build_ext","`","command","to","include","CUDA","C","source","files","."]
code: def build_extension(self, ext: setuptools.Extension) -> None:
      ctx = cupy_builder.get_context()
  
      # Compile "*.cu" files into object files.
      sources_cpp, extra_objects = compile_device_code(ctx, ext)
  
      # Remove device code from list of sources, and instead add compiled
      # object files to link.
      ext.sources = sources_cpp
      ext.extra_objects = extra_objects + ext.extra_objects
  
      # Let setuptools do the rest of the build process, i.e., compile
      # "*.cpp" files and link object files generated from "*.cu".
      super().build_extension(ext)
  
imports: import json
  import os
  import os.path
  import subprocess
  import sys
  from typing import Any, Dict, List, Tuple
  import setuptools
  import setuptools.command.build_ext
  import cupy_builder
  import cupy_builder.install_build
  from cupy_builder._context import Context
  from cupy_builder._compiler import DeviceCompilerUnix, DeviceCompilerWin32
label_desc: Use image node_id 3 for calling the custom_build_ext obj's underlying member method code with example usage: obj.build_extension(ext) without return types