class_docstr: Creates a Module from a single .cu source object linked against the
  dynamic CUDA runtime.
  - compiler generates PTX relocatable device code (rdc) from source that
    can be linked with other relocatable device code
  - source is linked against the CUDA device runtime library cudadevrt
  - library cudadevrt is statically linked into the generated Module
class_docstr_tok: ["Creates","a","Module","from","a","single",".cu","source","object","linked","against","the","dynamic","CUDA","runtime",".","-","compiler","generates","PTX","relocatable","device","code","(","rdc",")","from","source","that","can","be","linked","with","other","relocatable","device","code","-","source","is","linked","against","the","CUDA","device","runtime","library","cudadevrt","-","library","cudadevrt","is","statically","linked","into","the","generated","Module"]
code: def __init__(
      self,
      source,
      nvcc="nvcc",
      options=None,
      keep=False,
      no_extern_c=False,
      arch=None,
      code=None,
      cache_dir=None,
      include_dirs=[],
      cuda_libdir=None,
  ):
      super().__init__(
          nvcc=nvcc,
          link_options=None,
          keep=keep,
          no_extern_c=no_extern_c,
          arch=arch,
          code=code,
          cache_dir=cache_dir,
          include_dirs=include_dirs,
          cuda_libdir=cuda_libdir,
      )
      if options is None:
          options = DEFAULT_NVCC_FLAGS
      options = options[:]
      if "-rdc=true" not in options:
          options.append("-rdc=true")
      if "-lcudadevrt" not in options:
          options.append("-lcudadevrt")
      self.add_source(source, nvcc_options=options)
      self.add_stdlib("cudadevrt")
      self.link()
  
imports: from pytools import memoize
  import os
  import sys
  from tempfile import mkstemp
  from os import unlink
  from pytools.prefork import call_capture_output
label_desc: Use image node_id 1 to create a new DynamicSourceModule object from inherited base classes: DynamicModule with example: obj = DynamicSourceModule(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir, include_dirs, cuda_libdir)