code: def compile_cl(device: CLDevice, prg: str) -> bytes:
      program = checked(
          cl.clCreateProgramWithSource(
              device.context,
              1,
              to_char_p_p([prg_bytes := prg.encode()]),
              ctypes.byref(ctypes.c_size_t(len(prg_bytes))),
              ctypes.byref(status := ctypes.c_int32()),
          ),
          status,
      )
      status = cl.clBuildProgram(
          program,
          1,
          ctypes.byref(device.device_id),
          None,
          cl.clBuildProgram.argtypes[4](),
          None,
      )
      if status != 0:
          cl.clGetProgramBuildInfo(
              program,
              device.device_id,
              cl.CL_PROGRAM_BUILD_LOG,
              0,
              None,
              ctypes.byref(log_size := ctypes.c_size_t()),
          )
          cl.clGetProgramBuildInfo(
              program,
              device.device_id,
              cl.CL_PROGRAM_BUILD_LOG,
              log_size.value,
              mstr := ctypes.create_string_buffer(log_size.value),
              None,
          )  # noqa: E501
          raise RuntimeError(
              f"OpenCL Compile Error\n\n{ctypes.string_at(mstr, size=log_size.value).decode()}"
          )
      binary_sizes = init_c_var(
          (ctypes.c_size_t * 1)(),
          lambda x: check(
              cl.clGetProgramInfo(
                  program,
                  cl.CL_PROGRAM_BINARY_SIZES,
                  ctypes.sizeof(x),
                  ctypes.byref(x),
                  None,
              )
          ),
      )  # noqa: E501
      binary = init_c_var(
          ctypes.create_string_buffer(binary_sizes[0]),
          lambda x: check(
              cl.clGetProgramInfo(
                  program,
                  cl.CL_PROGRAM_BINARIES,
                  ctypes.sizeof(ctypes.c_void_p),
                  ctypes.byref(
                      (ctypes.c_void_p * 1)(ctypes.addressof(x))
                  ),
                  None,
              )
          ),
      )  # noqa: E501
      check(cl.clReleaseProgram(program))
      return bytes(binary)
  
imports: from __future__ import annotations
  from typing import Tuple, Optional, List
  import ctypes, functools, hashlib
  import gpuctypes.opencl
  from tinygrad.helpers import init_c_var, to_char_p_p, from_mv, OSX, DEBUG
  from tinygrad.dtype import ImageDType
  from tinygrad.codegen.kernel import LinearizerOptions
  from tinygrad.renderer.cstyle import OpenCLRenderer
  from tinygrad.device import Compiled, LRUAllocator
label_desc: Use image node_id 3 for calling a global function with example usage: compile_cl(device, prg) and returns: bytes