code: def __init__(self, device: CUDADevice, name: str, lib: bytes):
      self.device, self.name, self.lib = device, name, lib
      if DEBUG >= 5:
          print(
              "\n".join(
                  [
                      f"{i+1:>3} {line}"
                      for i, line in enumerate(
                          pretty_ptx(lib.decode("utf-8")).split("\n")
                      )
                  ]
              )
          )
      if DEBUG >= 6:
          try:
              fn = (
                  Path(tempfile.gettempdir())
                  / f"tinycuda_{hashlib.md5(lib).hexdigest()}"
              ).as_posix()
              with open(fn + ".ptx", "wb") as f:
                  f.write(lib)
              subprocess.run(
                  [
                      "ptxas",
                      f"-arch={device.arch}",
                      "-o",
                      fn,
                      fn + ".ptx",
                  ],
                  check=True,
              )
              print(
                  subprocess.check_output(["nvdisasm", fn]).decode(
                      "utf-8"
                  )
              )
          except Exception as e:
              print("failed to generate SASS", str(e))
  
      if not CUDACPU:
          check(cuda.cuCtxSetCurrent(self.device.context))
          self.module = init_c_var(
              cuda.CUmodule(),
              lambda x: check(
                  cuda.cuModuleLoadData(ctypes.byref(x), lib)
              ),
          )
          check(
              cuda.cuModuleGetFunction(
                  ctypes.byref(prg := cuda.CUfunction()),
                  self.module,
                  name.encode("utf-8"),
              )
          )
      self.prg = prg if not CUDACPU else lib
  
imports: from __future__ import annotations
  import subprocess, hashlib, tempfile, ctypes, ctypes.util, functools, re
  from pathlib import Path
  from typing import Tuple, Optional
  import gpuctypes.cuda
  from tinygrad.helpers import DEBUG, getenv, from_mv, init_c_var, colored, cpu_time_execution, compile_cuda_style, encode_args_cuda_style, time_execution_cuda_style
  from tinygrad.device import Compiled, LRUAllocator, MallocAllocator
  from tinygrad.codegen.kernel import LinearizerOptions
  from tinygrad.renderer.cstyle import CUDARenderer
label_desc: Use image node_id 1 to create a new CUDAProgram object  with example: obj = CUDAProgram(device, name, lib)