code: def test_ranged_elwise_kernel(ctx_factory):
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      from pyopencl.elementwise import ElementwiseKernel
  
      set_to_seven = ElementwiseKernel(
          context, "float *z", "z[i] = 7", "set_to_seven"
      )
  
      for _i, slc in enumerate(
          [
              slice(5, 20000),
              slice(5, 20000, 17),
              slice(3000, 5, -1),
              slice(1000, -1),
          ]
      ):
          a_gpu = cl.array.zeros(queue, (50000,), dtype=np.float32)
          a_cpu = np.zeros(a_gpu.shape, a_gpu.dtype)
  
          a_cpu[slc] = 7
          set_to_seven(a_gpu, slice=slc)
  
          assert (a_cpu == a_gpu.get()).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 3 for calling a global function with example usage: test_ranged_elwise_kernel(ctx_factory) without return types