class_docstr: Represent a single GPUDevice
docstr: Memory information in bytes
  
  Example:
  
      >>> print(ctx.device(0).memory())
      {'total': 4238016512L, 'used': 434831360L, 'free': 3803185152L}
  
  Returns:
      total/used/free memory in bytes
docstr_tok: ["Memory","information","in","bytes","Example",":",">",">",">","print","(","ctx.device","(","0",")",".memory","(",")",")","{","'total","'",":","4238016512L",",","'used","'",":","434831360L",",","'free","'",":","3803185152L","}","Returns",":","total\/used\/free","memory","in","bytes"]
code: def memory(self):
      """Memory information in bytes
  
      Example:
  
          >>> print(ctx.device(0).memory())
          {'total': 4238016512L, 'used': 434831360L, 'free': 3803185152L}
  
      Returns:
          total/used/free memory in bytes
      """
  
      class GpuMemoryInfo(Structure):
          _fields_ = [
              ("total", c_ulonglong),
              ("free", c_ulonglong),
              ("used", c_ulonglong),
          ]
  
      c_memory = GpuMemoryInfo()
      _check_return(
          _NVML.get_function("nvmlDeviceGetMemoryInfo")(
              self.hnd, byref(c_memory)
          )
      )
      return {
          "total": c_memory.total,
          "free": c_memory.free,
          "used": c_memory.used,
      }
  
imports: import threading
  from ctypes import CDLL, POINTER, Structure, byref, c_uint, c_ulonglong, create_string_buffer
label_desc: Use image node_id 2 for calling the NvidiaDevice obj's underlying member method code with example usage: obj.memory() and returns: dict