code: def test_knn_sharedmem_large(num_points):
      if not th.cuda.is_available():
          return
      x = th.randn(num_points, 5, device="cuda")
      y = th.randn(num_points, 5, device="cuda")
      k = 4
  
      def ground_truth(x, y, k):
          dist = (
              th.sum(x * x, dim=1)
              + th.sum(y * y, dim=1).unsqueeze(-1)
              - 2 * th.mm(y, x.T)
          )
          ret = th.topk(dist, k, dim=-1, largest=False)[1]
          return th.sort(ret, dim=-1)[0]
  
      gt = ground_truth(x, y, k)
      actual = th.sort(
          dgl.functional.knn(
              k,
              x,
              [num_points],
              y,
              [num_points],
              algorithm="bruteforce-sharemem",
          )[1].reshape(-1, k),
          -1,
      )[0]
      assert th.all(actual == gt).item()
  
file_path: dgl/tests/python/pytorch/geometry/test_geometry.py
imports: import backend
  import dgl
  import dgl.nn
  import numpy
  import pytest
  import torch
  from dgl import DGLError
  from dgl.base import DGLWarning
  from dgl.geometry import farthest_point_sampler, neighbor_matching
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 6 for calling a global function with example usage: test_knn_sharedmem_large(num_points) and returns: th