code: def test_invalid_kernel_names_cause_failures(ctx_factory):
      ctx = ctx_factory()
      device = ctx.devices[0]
      prg = cl.Program(
          ctx,
          """
          __kernel void sum(__global float *a)
          { a[get_global_id(0)] *= 2; }
          """,
      ).build()
  
      try:
          prg.sam
          raise RuntimeError("invalid kernel name did not cause error")
      except AttributeError:
          pass
      except RuntimeError:
          if "Intel" in device.platform.vendor:
              from pytest import xfail
  
              xfail(
                  "weird exception from OpenCL implementation "
                  "on invalid kernel name--are you using "
                  "Intel's implementation? (if so, known bug in Intel CL)"
              )
          else:
              raise
  
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 5 for calling a global function with example usage: test_invalid_kernel_names_cause_failures(ctx_factory) without return types