code: def test_reduction_not_first_argument(ctx_factory):
      # https://github.com/inducer/pyopencl/issues/535
      from pytest import importorskip
  
      importorskip("mako")
  
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      n = 400
      a = cl.array.arange(queue, n, dtype=np.float32)
      b = cl.array.arange(queue, n, dtype=np.float32)
  
      from pyopencl.reduction import ReductionKernel
  
      krnl = ReductionKernel(
          context,
          np.float32,
          neutral="0",
          reduce_expr="a+b",
          map_expr="z*x[i]*y[i]",
          arguments="float z, __global float *x, __global float *y",
      )
  
      my_dot_prod = krnl(0.1, a, b).get()
  
      assert abs(my_dot_prod - 0.1 * np.sum(np.arange(n) ** 2)) < 1e-4
  
imports: import numpy
  import numpy.linalg
  import sys
  from pytools import memoize
  from test_array import general_clrand
  import pytest
  import pyopencl
  import pyopencl.array
  from pyopencl.tools import pytest_generate_tests_for_pyopencl
  from pyopencl.characterize import has_double_support, has_struct_arg_count_bug
  from pyopencl.scan import InclusiveScanKernel, ExclusiveScanKernel, GenericScanKernel, GenericDebugScanKernel
  from pyopencl.characterize import get_pocl_version
label_desc: Use image node_id 12 for calling a global function with example usage: test_reduction_not_first_argument(ctx_factory) without return types