code: def __init__(
      self,
      dtype,
      scan_expr,
      neutral=None,
      name_prefix="scan",
      options=None,
      preamble="",
      devices=None,
  ):
      if isinstance(self, ExclusiveScanKernel) and neutral is None:
          raise ValueError(
              "neutral element is required for exclusive scan"
          )
  
      dtype = self.dtype = np.dtype(dtype)
      self.neutral = neutral
  
      # Thrust says these are good for GT200
      self.scan_wg_size = 128
      self.update_wg_size = 256
      self.scan_wg_seq_batches = 6
  
      kw_values = {
          "preamble": preamble,
          "name_prefix": name_prefix,
          "scan_type": dtype_to_ctype(dtype),
          "scan_expr": scan_expr,
          "neutral": neutral,
      }
  
      scan_intervals_src = str(
          SCAN_INTERVALS_SOURCE.render(
              wg_size=self.scan_wg_size,
              wg_seq_batches=self.scan_wg_seq_batches,
              **kw_values,
          )
      )
      scan_intervals_prg = SourceModule(
          scan_intervals_src, options=options, no_extern_c=True
      )
      self.scan_intervals_knl = scan_intervals_prg.get_function(
          name_prefix + "_scan_intervals"
      )
      self.scan_intervals_knl.prepare("PNIPP")
  
      final_update_src = str(
          self.final_update_tp.render(
              wg_size=self.update_wg_size, **kw_values
          )
      )
  
      final_update_prg = SourceModule(
          final_update_src, options=options, no_extern_c=True
      )
      self.final_update_knl = final_update_prg.get_function(
          name_prefix + "_final_update"
      )
      self.final_update_knl.prepare("PNIP")
  
file_path: pycuda/pycuda/scan.py
imports: import numpy
  import pycuda.driver
  import pycuda.gpuarray
  from pycuda.compiler import SourceModule
  from pycuda.tools import dtype_to_ctype
  import pycuda._mymako
  from pycuda._cluda import CLUDA_PREAMBLE
label_desc: Use image node_id 1 to create a new _ScanKernelBase object  with example: obj = _ScanKernelBase(dtype, scan_expr, neutral, name_prefix, options, preamble, devices)