code: def test_bitonic_argsort(ctx_factory, size, dtype):
      import sys
  
      is_pypy = "__pypy__" in sys.builtin_module_names
  
      if not size and is_pypy:
          # https://bitbucket.org/pypy/numpy/issues/53/specifying-strides-on-zero-sized-array
          pytest.xfail(
              "pypy doesn't seem to handle as_strided "
              "on zero-sized arrays very well"
          )
  
      ctx = cl.create_some_context()
      queue = cl.CommandQueue(ctx)
  
      device = queue.device
      if (
          device.platform.vendor == "The pocl project"
          and device.type & cl.device_type.GPU
      ):
          pytest.xfail(
              "bitonic argsort fails on PoCL + Nvidia,"
              "at least the K40, as of PoCL 1.6, 2021-01-20"
          )
      # Requires https://github.com/intel/llvm/releases/tag/2022-WW50 or newer to pass
      # on Intel CL.
  
      dev = ctx.devices[0]
      if (
          dev.platform.name == "Portable Computing Language"
          and sys.platform == "darwin"
      ):
          pytest.xfail("Bitonic sort crashes on Apple PoCL")
      if dev.platform.name == "Apple" and dev.type & cl.device_type.CPU:
          pytest.xfail(
              "Bitonic sort won't work on Apple CPU: no workgroup "
              "parallelism"
          )
      if (
          dev.platform.name == "Portable Computing Language"
          and dtype == np.float64
          and get_pocl_version(dev.platform) < (1, 0)
      ):
          pytest.xfail(
              "Double precision bitonic sort doesn't work on PoCL < 1.0"
          )
      if dev.platform.name == "Intel(R) OpenCL" and size == 0:
          pytest.xfail("size-0 arange fails on Intel CL")
  
      if dtype == np.float64 and not has_double_support(dev):
          from pytest import skip
  
          skip("double precision not supported on %s" % dev)
  
      import pyopencl.clrandom as clrandom
      from pyopencl.bitonic_sort import BitonicSort
  
      index = cl.array.arange(queue, 0, size, 1, dtype=np.int32)
      m = clrandom.rand(
          queue, (size,), dtype, luxury=None, a=0, b=239432234
      )
  
      sorterm = BitonicSort(ctx)
  
      ms = m.copy()
      # enqueue_marker crashes under CL 1.1 PoCL if there is anything to wait for
      # (no clEnqueueWaitForEvents) https://github.com/inducer/pyopencl/pull/237
      if (
          dev.platform.name == "Portable Computing Language"
          and cl.get_cl_header_version() < (1, 2)
      ):
          ms.finish()
          index.finish()
      ms, evt = sorterm(ms, idx=index, axis=0)
  
      assert np.array_equal(np.sort(m.get()), ms.get())
  
      # may be False because of identical values in array
      # assert np.array_equal(np.argsort(m.get()), index.get())
  
      # Check values by indices
      assert np.array_equal(
          m.get()[np.argsort(m.get())], m.get()[index.get()]
      )
  
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 33 for calling a global function with example usage: test_bitonic_argsort(ctx_factory, size, dtype) without return types