code: def test_grid_group_cu116_new_APIs(self):
      @jit.rawkernel()
      def test_grid(x):
          g = jit.cg.this_grid()
          if g.thread_rank() == 1:
              x[1] = g.num_threads()
          if g.thread_rank() == 32:
              g_dim = g.dim_blocks()
              x[2], x[3], x[4] = g_dim.x, g_dim.y, g_dim.z
          if g.thread_rank() == 33:  # on the 2nd block
              x[5] = g.block_rank()
          if g.thread_rank() == 2:
              x[6] = g.num_blocks()
          if g.thread_rank() == 34:  # on the 2nd block
              b_idx = g.block_index()
              x[7], x[8], x[9] = b_idx.x, b_idx.y, b_idx.z
          g.sync()  # this should just work!
  
      x = cupy.empty((16,), dtype=cupy.uint64)
      x[:] = -1  # = 2**64-1
      test_grid[2, 32](x)
      assert x[1] == 64
      assert (x[2], x[3], x[4]) == (2, 1, 1)
      assert x[5] == 1
      assert x[6] == 2
      assert (x[7], x[8], x[9]) == (1, 0, 0)
      assert (x[10:] == 2**64 - 1).all()
  
file_path: cupy/tests/cupyx_tests/jit_tests/test_cooperative_groups.py
imports: import pytest
  import cupy
  from cupy.cuda import runtime
  from cupyx import jit
label_desc: Use image node_id 4 for calling the TestCooperativeGroups obj's underlying member method code with example usage: obj.test_grid_group_cu116_new_APIs() without return types