elementwise_op.h 748 Bytes
Newer Older
Hongzhi (Steve), Chen's avatar
Hongzhi (Steve), Chen committed
1
/**
2
 *  Copyright (c) 2022 by Contributors
Hongzhi (Steve), Chen's avatar
Hongzhi (Steve), Chen committed
3
 * @file sparse/elementwise_op.h
czkkkkkk's avatar
czkkkkkk committed
4
 * @brief DGL C++ sparse elementwise operators.
5
6
7
8
9
10
11
12
13
14
 */
#ifndef SPARSE_ELEMENTWISE_OP_H_
#define SPARSE_ELEMENTWISE_OP_H_

#include <sparse/sparse_matrix.h>

namespace dgl {
namespace sparse {

// TODO(zhenkun): support addition of matrices with different sparsity.
Hongzhi (Steve), Chen's avatar
Hongzhi (Steve), Chen committed
15
/**
16
17
 * @brief Adds two sparse matrices. Currently does not support two matrices with
 * different sparsity.
Hongzhi (Steve), Chen's avatar
Hongzhi (Steve), Chen committed
18
 *
19
20
 * @param A SparseMatrix
 * @param B SparseMatrix
Hongzhi (Steve), Chen's avatar
Hongzhi (Steve), Chen committed
21
 *
22
23
24
25
26
27
28
29
30
31
 * @return SparseMatrix
 */
c10::intrusive_ptr<SparseMatrix> SpSpAdd(
    const c10::intrusive_ptr<SparseMatrix>& A,
    const c10::intrusive_ptr<SparseMatrix>& B);

}  // namespace sparse
}  // namespace dgl

#endif  // SPARSE_ELEMENTWISE_OP_H_