code: def get_minmaximum_kernel(
      context,
      minmax,
      dtype_z,
      dtype_x,
      dtype_y,
      kind_x: ArgumentKind,
      kind_y: ArgumentKind,
  ):
      if dtype_z.kind == "f":
          reduce_func = f"f{minmax}_nanprop"
      elif dtype_z.kind in "iu":
          reduce_func = minmax
      else:
          raise TypeError("unsupported dtype specified")
  
      tp_x = dtype_to_ctype(dtype_x)
      tp_y = dtype_to_ctype(dtype_y)
      tp_z = dtype_to_ctype(dtype_z)
      decl_x, acc_x = get_decl_and_access_for_kind("x", kind_x)
      decl_y, acc_y = get_decl_and_access_for_kind("y", kind_y)
  
      return get_elwise_kernel(
          context,
          f"{tp_z} *z, {tp_x} {decl_x}, {tp_y} {decl_y}",
          f"z[i] = {reduce_func}({acc_x}, {acc_y})",
          name=f"{minmax}imum",
          preamble="""
                  #define fmin_nanprop(a, b) (isnan(a) || isnan(b)) ? a+b : fmin(a, b)
                  #define fmax_nanprop(a, b) (isnan(a) || isnan(b)) ? a+b : fmax(a, b)
                  """,
      )
  
imports: import enum
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import pyopencl
  from pyopencl.tools import context_dependent_memoize
  from pyopencl.tools import dtype_to_ctype, DtypedArgument, VectorArg, ScalarArg, KernelTemplateBase, dtype_to_c_struct
  from pytools import memoize_method
label_desc: Use image node_id 33 for calling a global function with example usage: get_minmaximum_kernel(context, minmax, dtype_z, dtype_x, dtype_y, kind_x, kind_y) and returns: get_elwise_kernel