code: def test_compile_link(ctx_factory):
      ctx = ctx_factory()
  
      if ctx._get_cl_version() < (
          1,
          2,
      ) or cl.get_cl_header_version() < (1, 2):
          pytest.skip(
              "Context and ICD loader must understand CL1.2 for compile/link"
          )
  
      platform = ctx.devices[0].platform
      if platform.name == "Apple":
          pytest.skip("Apple doesn't like our compile/link test")
  
      # as of pocl 5.0
      _xfail_if_pocl_gpu(ctx.devices[0], "compile/link")
  
      queue = cl.CommandQueue(ctx)
      vsink_prg = cl.Program(
          ctx,
          """//CL//
          void value_sink(float x)
          {
          }
          """,
      ).compile()
      pi_h__prg = cl.Program(
          ctx,
          """//CL//
          inline float get_pi()
          {
              return 3.1415f;
          }
          """,
      ).compile()
      main_prg = cl.Program(
          ctx,
          """//CL//
          #include "pi.h"
  
          void value_sink(float x);
  
          __kernel void experiment()
          {
              value_sink(get_pi() + get_global_id(0));
          }
          """,
      ).compile(headers=[("pi.h", pi_h__prg)])
      z = cl.link_program(
          ctx, [vsink_prg, main_prg], devices=ctx.devices
      )
      z.experiment(queue, (128**2,), (128,))
      queue.finish()
  
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 35 for calling a global function with example usage: test_compile_link(ctx_factory) without return types