code: def get_bessel_kernel(
      context,
      which_func,
      out_dtype=np.float64,
      order_dtype=np.int32,
      x_dtype=np.float64,
  ):
      if x_dtype.kind != "c":
          return get_elwise_kernel(
              context,
              [
                  VectorArg(out_dtype, "z", with_offset=True),
                  ScalarArg(order_dtype, "ord_n"),
                  VectorArg(x_dtype, "x", with_offset=True),
              ],
              f"z[i] = bessel_{which_func}n(ord_n, x[i])",
              name=f"bessel_{which_func}n_kernel",
              preamble=f"""
              #if __OPENCL_C_VERSION__ < 120
              #pragma OPENCL EXTENSION cl_khr_fp64: enable
              #endif
              #define PYOPENCL_DEFINE_CDOUBLE
              #include <pyopencl-bessel-{which_func}.cl>
              """,
          )
      else:
          if which_func != "j":
              raise NotImplementedError(
                  "complex arguments for Bessel Y"
              )
  
          if x_dtype != np.complex128:
              raise NotImplementedError("non-complex double dtype")
          if x_dtype != out_dtype:
              raise NotImplementedError("different input/output types")
  
          return get_elwise_kernel(
              context,
              [
                  VectorArg(out_dtype, "z", with_offset=True),
                  ScalarArg(order_dtype, "ord_n"),
                  VectorArg(x_dtype, "x", with_offset=True),
              ],
              """
              cdouble_t jv_loc;
              cdouble_t jvp1_loc;
              bessel_j_complex(ord_n, x[i], &jv_loc, &jvp1_loc);
              z[i] = jv_loc;
              """,
              name="bessel_j_complex_kernel",
              preamble="""
              #if __OPENCL_C_VERSION__ < 120
              #pragma OPENCL EXTENSION cl_khr_fp64: enable
              #endif
              #define PYOPENCL_DEFINE_CDOUBLE
              #include <pyopencl-complex.h>
              #include <pyopencl-bessel-j-complex.cl>
              """,
          )
  
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 34 for calling a global function with example usage: get_bessel_kernel(context, which_func, out_dtype, order_dtype, x_dtype) and returns: get_elwise_kernel, get_elwise_kernel