code: def test_subset_minmax(ctx_factory):
      from pytest import importorskip
  
      importorskip("mako")
  
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      from pyopencl.clrandom import rand as clrand
  
      l_a = 200000
      gran = 5
      l_m = l_a - l_a // gran + 1
  
      if has_double_support(context.devices[0]):
          dtypes = [np.float64, np.float32, np.int32]
      else:
          dtypes = [np.float32, np.int32]
  
      for dtype in dtypes:
          a_gpu = clrand(queue, (l_a,), dtype)
          a = a_gpu.get()
  
          meaningful_indices_gpu = cl.array.zeros(
              queue, l_m, dtype=np.int32
          )
          meaningful_indices = meaningful_indices_gpu.get()
          j = 0
          for i in range(len(meaningful_indices)):
              meaningful_indices[i] = j
              j = j + 1
              if j % gran == 0:
                  j = j + 1
  
          meaningful_indices_gpu = cl.array.to_device(
              queue, meaningful_indices
          )
          b = a[meaningful_indices]
  
          min_a = np.min(b)
          min_a_gpu = cl.array.subset_min(
              meaningful_indices_gpu, a_gpu
          ).get()
  
          assert min_a_gpu == min_a
  
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 14 for calling a global function with example usage: test_subset_minmax(ctx_factory) without return types