code: def __init__(self, dev=None):
      import pycuda.driver as drv
  
      if dev is None:
          dev = cuda.Context.get_device()
  
      self.max_threads = dev.get_attribute(
          drv.device_attribute.MAX_THREADS_PER_BLOCK
      )
      self.warp_size = dev.get_attribute(drv.device_attribute.WARP_SIZE)
  
      if dev.compute_capability() >= (3, 0):
          self.warps_per_mp = 64
      elif dev.compute_capability() >= (2, 0):
          self.warps_per_mp = 48
      elif dev.compute_capability() >= (1, 2):
          self.warps_per_mp = 32
      else:
          self.warps_per_mp = 24
  
      self.thread_blocks_per_mp = 8
      self.registers = dev.get_attribute(
          drv.device_attribute.MAX_REGISTERS_PER_BLOCK
      )
      self.shared_memory = dev.get_attribute(
          drv.device_attribute.MAX_SHARED_MEMORY_PER_BLOCK
      )
  
      if dev.compute_capability() >= (2, 0):
          self.smem_alloc_granularity = 128
          self.smem_granularity = 32
      else:
          self.smem_alloc_granularity = 512
          self.smem_granularity = 16
  
      if dev.compute_capability() >= (2, 0):
          self.register_allocation_unit = "warp"
      else:
          self.register_allocation_unit = "block"
  
imports: import pycuda.driver
  import pycuda._driver
  import numpy
  from pycuda.compyte.dtypes import register_dtype, get_or_register_dtype, _fill_dtype_registry, dtype_to_ctype
label_desc: Use image node_id 1 to create a new DeviceData object  with example: obj = DeviceData(dev)