code: def test_sub_buffers(ctx_factory):
      ctx = ctx_factory()
      if ctx._get_cl_version() < (
          1,
          1,
      ) or cl.get_cl_header_version() < (1, 1):
          from pytest import skip
  
          skip("sub-buffers are only available in OpenCL 1.1")
  
      alignment = ctx.devices[0].mem_base_addr_align
  
      queue = cl.CommandQueue(ctx)
  
      n = 30000
  
      rng = np.random.default_rng(seed=42)
      a = (rng.random(n) * 100).astype(np.uint8)
  
      mf = cl.mem_flags
      a_buf = cl.Buffer(
          ctx, mf.READ_WRITE | mf.COPY_HOST_PTR, hostbuf=a
      )
  
      start = (5000 // alignment) * alignment
      stop = start + 20 * alignment
  
      a_sub_ref = a[start:stop]
  
      a_sub = np.empty_like(a_sub_ref)
      cl.enqueue_copy(queue, a_sub, a_buf[start:stop])
  
      assert np.array_equal(a_sub, a_sub_ref)
  
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 30 for calling a global function with example usage: test_sub_buffers(ctx_factory) without return types