code: def get_axpbyz_kernel(
      context,
      dtype_x,
      dtype_y,
      dtype_z,
      x_is_scalar=False,
      y_is_scalar=False,
  ):
      result_t = dtype_to_ctype(dtype_z)
  
      x_is_complex = dtype_x.kind == "c"
      y_is_complex = dtype_y.kind == "c"
  
      x = "x[0]" if x_is_scalar else "x[i]"
      y = "y[0]" if y_is_scalar else "y[i]"
  
      if dtype_z.kind == "c":
          # a and b will always be complex here.
          z_ct = complex_dtype_to_name(dtype_z)
  
          if x_is_complex:
              ax = f"{z_ct}_mul(a, {z_ct}_cast({x}))"
          else:
              ax = f"{z_ct}_mulr(a, {x})"
  
          if y_is_complex:
              by = f"{z_ct}_mul(b, {z_ct}_cast({y}))"
          else:
              by = f"{z_ct}_mulr(b, {y})"
  
          result = f"{z_ct}_add({ax}, {by})"
      else:
          # real-only
  
          ax = f"a*(({result_t}) {x})"
          by = f"b*(({result_t}) {y})"
  
          result = f"{ax} + {by}"
  
      return get_elwise_kernel(
          context,
          "{tp_z} *z, {tp_z} a, {tp_x} *x, {tp_z} b, {tp_y} *y".format(
              tp_x=dtype_to_ctype(dtype_x),
              tp_y=dtype_to_ctype(dtype_y),
              tp_z=dtype_to_ctype(dtype_z),
          ),
          f"z[i] = {result}",
          name="axpbyz",
      )
  
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 12 for calling a global function with example usage: get_axpbyz_kernel(context, dtype_x, dtype_y, dtype_z, x_is_scalar, y_is_scalar) and returns: get_elwise_kernel