MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / arithOp

Function arithOp

src/backend/cpu/sparse_arith.cpp:88–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87template<typename T, af_op_t op>
88SparseArray<T> arithOp(const SparseArray<T> &lhs, const Array<T> &rhs,
89 const bool reverse) {
90 SparseArray<T> out = createArrayDataSparseArray<T>(
91 lhs.dims(), lhs.getValues(), lhs.getRowIdx(), lhs.getColIdx(),
92 lhs.getStorage(), true);
93 switch (out.getStorage()) {
94 case AF_STORAGE_CSR:
95 getQueue().enqueue(kernel::sparseArithOpS<T, op, AF_STORAGE_CSR>,
96 out.getValues(), out.getRowIdx(),
97 out.getColIdx(), rhs, reverse);
98 break;
99 case AF_STORAGE_COO:
100 getQueue().enqueue(kernel::sparseArithOpS<T, op, AF_STORAGE_COO>,
101 out.getValues(), out.getRowIdx(),
102 out.getColIdx(), rhs, reverse);
103 break;
104 default:
105 AF_ERROR("Sparse Arithmetic only supported for CSR or COO",
106 AF_ERR_NOT_SUPPORTED);
107 }
108
109 return out;
110}
111
112template<typename T, af_op_t op>
113SparseArray<T> arithOp(const SparseArray<T> &lhs, const SparseArray<T> &rhs) {

Callers

nothing calls this directly

Calls 8

getStorageMethod · 0.80
dim4Class · 0.70
copyArrayFunction · 0.70
getQueueFunction · 0.50
dimsMethod · 0.45
enqueueMethod · 0.45
syncMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected