code: def test_bitonic_sort(ctx_factory, size, dtype):
      ctx = cl.create_some_context()
      queue = cl.CommandQueue(ctx)
  
      dev = ctx.devices[0]
      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 dtype == np.float64 and not has_double_support(dev):
          from pytest import skip
  
          skip("double precision not supported on %s" % dev)
      # Requires https://github.com/intel/llvm/releases/tag/2022-WW50 or newer to pass
      # on Intel CL.
  
      import pyopencl.clrandom as clrandom
      from pyopencl.bitonic_sort import BitonicSort
  
      s = clrandom.rand(
          queue,
          (
              2,
              size,
              3,
          ),
          dtype,
          luxury=None,
          a=0,
          b=239482333,
      )
      sgs = s.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)
      ):
          sgs.finish()
      sorter = BitonicSort(ctx)
      sgs, evt = sorter(sgs, axis=1)
      assert np.array_equal(np.sort(s.get(), axis=1), sgs.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 32 for calling a global function with example usage: test_bitonic_sort(ctx_factory, size, dtype) without return types