code: def _make_sort_scan_type(device, bits, index_dtype):
      name = "pyopencl_sort_scan_%s_%dbits_t" % (
          index_dtype.type.__name__,
          bits,
      )
  
      fields = []
      for mnr in range(2**bits):
          fields.append(("c%s" % _padded_bin(mnr, bits), index_dtype))
  
      dtype = np.dtype(fields)
  
      from pyopencl.tools import (
          get_or_register_dtype,
          match_dtype_to_c_struct,
      )
  
      dtype, c_decl = match_dtype_to_c_struct(device, name, dtype)
  
      dtype = get_or_register_dtype(name, dtype)
      return name, dtype, c_decl
  
imports: from dataclasses import dataclass
  from typing import Optional
  import numpy
  import pyopencl
  import pyopencl.array
  from pyopencl.elementwise import ElementwiseKernel
  from pyopencl.scan import ScanTemplate, GenericScanKernel
  from pyopencl.tools import dtype_to_ctype, get_arg_offset_adjuster_code
  from pytools import memoize, memoize_method
  from mako.template import Template
label_desc: Use image node_id 8 for calling a global function with example usage: _make_sort_scan_type(device, bits, index_dtype) and returns: name,  dtype,  c_decl