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

Function ssArithCSR

src/backend/opencl/kernel/sparse_arith.hpp:165–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164template<typename T, af_op_t op>
165void ssArithCSR(Param oVals, Param oColIdx, const Param oRowIdx, const uint M,
166 const uint N, unsigned nnzA, const Param lVals,
167 const Param lRowIdx, const Param lColIdx, unsigned nnzB,
168 const Param rVals, const Param rRowIdx, const Param rColIdx) {
169 const T iden_val =
170 (op == af_mul_t || op == af_div_t ? scalar<T>(1) : scalar<T>(0));
171
172 auto arithOp = fetchKernel<T, op>(
173 "ssarith_csr", sp_sp_arith_csr_cl_src,
174 {DefineKeyValue(IDENTITY_VALUE, scalar_to_option(iden_val))});
175
176 cl::NDRange local(256, 1);
177 cl::NDRange global(divup(M, local[0]) * local[0], 1, 1);
178
179 arithOp(cl::EnqueueArgs(getQueue(), global, local), *oVals.data,
180 *oColIdx.data, *oRowIdx.data, M, N, nnzA, *lVals.data,
181 *lRowIdx.data, *lColIdx.data, nnzB, *rVals.data, *rRowIdx.data,
182 *rColIdx.data);
183 CL_DEBUG_FINISH(getQueue());
184}
185} // namespace kernel
186} // namespace opencl
187} // namespace arrayfire

Callers

nothing calls this directly

Calls 4

EnqueueArgsClass · 0.85
scalar_to_optionFunction · 0.50
arithOpFunction · 0.50
getQueueFunction · 0.50

Tested by

no test coverage detected