code: def test_platform_get_devices(ctx_factory):
      ctx = ctx_factory()
      platform = ctx.devices[0].platform
  
      if platform.name == "Apple":
          pytest.xfail(
              "Apple doesn't understand all the values we pass "
              "for dev_type"
          )
  
      dev_types = [
          cl.device_type.ACCELERATOR,
          cl.device_type.ALL,
          cl.device_type.CPU,
          cl.device_type.DEFAULT,
          cl.device_type.GPU,
      ]
      if (
          platform._get_cl_version() >= (1, 2)
          and cl.get_cl_header_version() >= (1, 2)
          and not platform.name.lower().startswith("nvidia")
      ):
          dev_types.append(cl.device_type.CUSTOM)
  
      for dev_type in dev_types:
          print(dev_type)
          devs = platform.get_devices(dev_type)
          if dev_type in (
              cl.device_type.DEFAULT,
              cl.device_type.ALL,
              getattr(cl.device_type, "CUSTOM", None),
          ):
              continue
          for dev in devs:
              assert dev.type & dev_type == dev_type
  
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 24 for calling a global function with example usage: test_platform_get_devices(ctx_factory) without return types