MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / assign

Function assign

extensions/include/cuMat/src/SparseProductEvaluation.h:116–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 "SparseMatrix - DenseVector does only support compile-time fixed batch count");
115
116 static void assign(_Dst& dst, const Op& op) {
117
118 typedef typename _Dst::Type DstActual;
119 CUMAT_PROFILING_INC(EvalMatmulSparse);
120 CUMAT_PROFILING_INC(EvalAny);
121 if (dst.size() == 0) return;
122 CUMAT_ASSERT(op.rows() == dst.rows());
123 CUMAT_ASSERT(op.cols() == dst.cols());
124 CUMAT_ASSERT(op.batches() == dst.batches());
125 CUMAT_ASSERT(op.batches() == Op::Batches);
126
127 CUMAT_LOG_DEBUG("Evaluate SparseMatrix-DenseVector multiplication " << typeid(op.derived()).name()
128 << " matrix rows=" << op.derived().left().rows() << ", cols=" << op.left().cols());;
129
130 //here is now the real logic
131 Context& ctx = Context::current();
132 KernelLaunchConfig cfg = ctx.createLaunchConfig1D(dst.rows(), kernels::CSRMVKernel_StaticBatches<SrcLeft, typename _SrcRight::Type, DstActual, _AssignmentMode, Op::Batches>);
133 kernels::CSRMVKernel_StaticBatches<SrcLeft, typename _SrcRight::Type, DstActual, _AssignmentMode, Op::Batches>
134 <<<cfg.block_count, cfg.thread_per_block, 0, ctx.stream() >>>
135 (cfg.virtual_size, op.derived().left().derived(), op.derived().right().derived(), dst.derived());
136 CUMAT_CHECK_ERROR();
137 CUMAT_LOG_DEBUG("Evaluation done");
138 }
139 };
140
141 //CwiseSrcTag (SparseExpressionOp) * CwiseSrcTag (Dense-Vector) -> DenseDstTag (Vector-Vector), sparse matrix-vector product

Callers 3

assignMethod · 0.70

Calls 6

sizeMethod · 0.80
createLaunchConfig1DMethod · 0.80
streamMethod · 0.80
rowsMethod · 0.45
colsMethod · 0.45
batchesMethod · 0.45

Tested by

no test coverage detected