code: def test_dot(ctx_factory):
      from pytest import importorskip
  
      importorskip("mako")
  
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      dev = context.devices[0]
  
      dtypes = [np.float32, np.complex64]
      if has_double_support(dev):
          if has_struct_arg_count_bug(dev) == "apple":
              dtypes.extend([np.float64])
          else:
              dtypes.extend([np.float64, np.complex128])
  
      for a_dtype in dtypes:
          for b_dtype in dtypes:
              print(a_dtype, b_dtype)
              a_gpu = general_clrand(queue, (200000,), a_dtype)
              a = a_gpu.get()
              b_gpu = general_clrand(queue, (200000,), b_dtype)
              b = b_gpu.get()
  
              dot_ab = np.dot(a, b)
              dot_ab_gpu = cl.array.dot(a_gpu, b_gpu).get()
  
              assert abs(dot_ab_gpu - dot_ab) / abs(dot_ab) < 1e-4
  
              try:
                  vdot_ab = np.vdot(a, b)
              except NotImplementedError:
                  import sys
  
                  is_pypy = "__pypy__" in sys.builtin_module_names
                  if is_pypy:
                      print("PYPY: VDOT UNIMPLEMENTED")
                      continue
                  else:
                      raise
  
              vdot_ab_gpu = cl.array.vdot(a_gpu, b_gpu).get()
  
              rel_err = abs(vdot_ab_gpu - vdot_ab) / abs(vdot_ab)
              assert rel_err < 1e-4, rel_err
  
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 15 for calling a global function with example usage: test_dot(ctx_factory) without return types