class_docstr: Class surrounding CURAND kernels from CUDA 3.2.
  It allows for generating random numbers with uniform
  and normal probability function of various types.
code: def __init__(
      self,
      state_type,
      vector_type,
      generator_bits,
      additional_source,
      scramble_type=None,
  ):
      if get_curand_version() < (3, 2, 0):
          raise OSError("Need at least CUDA 3.2")
  
      dev = drv.Context.get_device()
  
      self.block_count = dev.get_attribute(
          pycuda.driver.device_attribute.MULTIPROCESSOR_COUNT
      )
  
      from pycuda.characterize import has_double_support
  
      def do_generate(out_type):
          result = True
          if "double" in out_type:
              result = result and has_double_support()
          if "2" in out_type:
              result = result and self.has_box_muller
          return result
  
      my_generators = [
          (name, out_type, suffix)
          for name, out_type, suffix in self.gen_info
          if do_generate(out_type)
      ]
  
      if get_curand_version() >= (4, 0, 0):
          my_log_generators = [
              (name, in_type, out_type, suffix)
              for name, in_type, out_type, suffix in self.gen_log_info
              if do_generate(out_type)
          ]
  
      if get_curand_version() >= (5, 0, 0):
          my_poisson_generators = [
              (name, out_type, suffix)
              for name, out_type, suffix in self.gen_poisson_info
              if do_generate(out_type)
          ]
          my_poisson_inplace_generators = [
              (name, inout_type, suffix)
              for name, inout_type, suffix in self.gen_poisson_inplace_info
              if do_generate(inout_type)
          ]
  
      generator_sources = [
          gen_template
          % {
              "name": name,
              "out_type": out_type,
              "suffix": suffix,
              "state_type": state_type,
          }
          for name, out_type, suffix in my_generators
      ]
  
      if get_curand_version() >= (4, 0, 0):
          generator_sources.extend(
              [
                  gen_log_template
                  % {
                      "name": name,
                      "in_type": in_type,
                      "out_type": out_type,
                      "suffix": suffix,
                      "state_type": state_type,
                  }
                  for name, in_type, out_type, suffix in my_log_generators
              ]
          )
  
      if get_curand_version() >= (5, 0, 0):
          generator_sources.extend(
              [
                  gen_poisson_template
                  % {
                      "name": name,
                      "out_type": out_type,
                      "suffix": suffix,
                      "state_type": state_type,
                  }
                  for name, out_type, suffix in my_poisson_generators
              ]
          )
          generator_sources.extend(
              [
                  gen_poisson_inplace_template
                  % {
                      "name": name,
                      "inout_type": inout_type,
                      "suffix": suffix,
                      "state_type": state_type,
                  }
                  for name, inout_type, suffix in my_poisson_inplace_generators
              ]
          )
  
      source = (random_source + additional_source) % {
          "state_type": state_type,
          "vector_type": vector_type,
          "scramble_type": scramble_type,
          "generators": "\n".join(generator_sources),
      }
  
      # store in instance to let subclass constructors get to it.
      self.module = module = pycuda.compiler.SourceModule(
          source, no_extern_c=True
      )
  
      self.generators = {}
      for name, out_type, suffix in my_generators:
          gen_func = module.get_function(name)
          gen_func.prepare("PPn")
          self.generators[name] = gen_func
      if get_curand_version() >= (4, 0, 0):
          for name, in_type, out_type, suffix in my_log_generators:
              gen_func = module.get_function(name)
              if in_type == "float":
                  gen_func.prepare("PPffn")
              if in_type == "double":
                  gen_func.prepare("PPddn")
              self.generators[name] = gen_func
      if get_curand_version() >= (5, 0, 0):
          for name, out_type, suffix in my_poisson_generators:
              gen_func = module.get_function(name)
              gen_func.prepare("PPdn")
              self.generators[name] = gen_func
          for name, inout_type, suffix in my_poisson_inplace_generators:
              gen_func = module.get_function(name)
              gen_func.prepare("PPn")
              self.generators[name] = gen_func
  
      self.generator_bits = generator_bits
      self._prepare_skipahead()
  
      self.state_type = state_type
      self._state = None
  
imports: import numpy
  import pycuda.compiler
  import pycuda.driver
  import pycuda.gpuarray
  from pytools import memoize_method
label_desc: Use image node_id 1 to create a new _RandomNumberGeneratorBase object  with example: obj = _RandomNumberGeneratorBase(state_type, vector_type, generator_bits, additional_source, scramble_type)