code: def _addup_x_in_group(group, x, result):
      addup_x_in_group_kernel = cp.RawKernel(
          r"""
          extern "C" __global__
          void addup_x_in_group(const int* group, const float* x,
              float* result, int N)
          {
              int tid = blockDim.x * blockIdx.x + threadIdx.x;
              if(tid<N){
                  atomicAdd(result + group[tid] - 1, x[tid]);
              }
          }
      """,
          "addup_x_in_group",
      )
  
      N = x.shape[0]
      tpb = 256
      bpg = math.ceil(N / tpb)
      addup_x_in_group_kernel((bpg,), (tpb,), (group, x, result, N))
      return result
  
file_path: cuml/python/cuml/metrics/_ranking.py
imports: import math
  from cuml.internals.input_utils import input_to_cupy_array
  from cuml.internals.array import CumlArray
  import cuml.internals
  from cuml.internals.safe_imports import cpu_only_import
  import typing
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 5 for calling a global function with example usage: _addup_x_in_group(group, x, result) and returns: result