code: def test_unique(ctx_factory):
      from pytest import importorskip
  
      importorskip("mako")
  
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      from pyopencl.clrandom import rand as clrand
  
      for n in scan_test_counts:
          a_dev = clrand(queue, (n,), dtype=np.int32, a=0, b=1000)
          a = a_dev.get()
          a = np.sort(a)
          a_dev = cl.array.to_device(queue, a)
  
          a_unique_host = np.unique(a)
  
          from pyopencl.algorithm import unique
  
          a_unique_dev, count_unique_dev, evt = unique(a_dev)
  
          count_unique_dev = count_unique_dev.get()
  
          assert (
              a_unique_dev.get()[:count_unique_dev] == a_unique_host
          ).all()
          from gc import collect
  
          collect()
  
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 23 for calling a global function with example usage: test_unique(ctx_factory) without return types