code: def _cupy_coo_matmul():
      utils.nondeterministic("atomicAdd")
      return cuda.elementwise(
          "int32 nb, int32 _m, int32 _n, int32 _k, int32 nnz, int32 chunk, \
           raw A A_data, raw T A_row, raw T A_col, \
           raw B _B",
          "raw C _C",
          """
          int i_n = (i % _n);
          int i0 = (i / _n) * chunk;
          int i_C = -1;
          C val_C = 0;
          for (int i1 = 0; i1 < chunk; i1++) {
              int i_A = i0 + i1;
              int i_b = i_A / nnz;
              if (i_b >= nb) {
                  continue;
              }
              int i_k = A_col[i_A];
              if (i_k < 0) {
                  continue;
              }
              assert(i_k < _k);
              int i_m = A_row[i_A];
              if (i_m < 0) {
                  continue;
              }
              assert(i_m < _m);
              int i_B = i_n + _n * (i_k + _k * i_b);
              int i_C_now = i_n + _n * (i_m + _m * i_b);
              A val_A = A_data[i_A];
              B val_B = _B[i_B];
              C val_C_now = static_cast<C>(val_A * val_B);
              if (i_C >= 0 && i_C != i_C_now) {
                  atomicAdd(&_C[i_C], val_C);
                  val_C = 0;
              }
              i_C = i_C_now;
              val_C += val_C_now;
          }
          if (i_C >= 0) {
              atomicAdd(&_C[i_C], val_C);
          }
          """,
          "coo_matmul",
      )
  
imports: import numpy
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 4 for calling a global function with example usage: _cupy_coo_matmul() and returns: cuda