code: def test_scan_with_vectorargs_with_offsets(ctx_factory, scan_cls):
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      from pyopencl.tools import VectorArg
  
      knl = scan_cls(
          context,
          float,
          arguments=[
              VectorArg(float, "input", with_offset=True),
              VectorArg(int, "segment", with_offset=True),
          ],
          input_expr="input[i]",
          is_segment_start_expr="segment[i]",
          scan_expr="a+b",
          neutral="0",
          output_statement="""
                  input[i] = item;
                  """,
      )
  
      n = 20
  
      rng = np.random.default_rng(seed=42)
      host_data = rng.integers(0, 10, n).astype(np.float64)
      dev_data = cl.array.to_device(queue, host_data)
      segment_data = np.zeros(n, dtype=int)
      dev_segment_data = cl.array.to_device(queue, segment_data)
  
      knl(dev_data, dev_segment_data)
  
      assert (dev_data.get() == np.cumsum(host_data)).all()
  
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 20 for calling a global function with example usage: test_scan_with_vectorargs_with_offsets(ctx_factory, scan_cls) without return types