code: def test_global_offset(ctx_factory):
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      _xfail_if_pocl_gpu(queue.device, "global offset")
  
      prg = cl.Program(
          context,
          """
          __kernel void mult(__global float *a)
          { a[get_global_id(0)] *= 2; }
          """,
      ).build()
  
      n = 50
  
      rng = np.random.default_rng(seed=42)
      a = rng.random(n, dtype=np.float32)
  
      queue = cl.CommandQueue(context)
      mf = cl.mem_flags
      a_buf = cl.Buffer(
          context, mf.READ_WRITE | mf.COPY_HOST_PTR, hostbuf=a
      )
  
      step = 10
      for ofs in range(0, n, step):
          prg.mult(queue, (step,), None, a_buf, global_offset=(ofs,))
  
      a_2 = np.empty_like(a)
      cl.enqueue_copy(queue, a_2, a_buf)
  
      assert (a_2 == 2 * a).all()
  
imports: import numpy
  import numpy.linalg
  import pytest
  import pyopencl
  import pyopencl.array
  import pyopencl.cltypes
  import pyopencl.clrandom
  from pyopencl.tools import pytest_generate_tests_for_pyopencl, ImmediateAllocator, DeferredAllocator
  from pyopencl.characterize import get_pocl_version
label_desc: Use image node_id 29 for calling a global function with example usage: test_global_offset(ctx_factory) without return types