Hi everybody :)

Okay, so in the roadmap i've added Reductions support for ViennaCL 1.6 ...
I plan to take care of it for the three backends, but there are several
things to consider here. For now, I will call them reduce<>, reduce_rows<>,
reduce_cols<>. A convenience layer such that reduce(mat.rows()) or
reduce(mat.cols()) would be better, but this is a completely different
problem :P

>From a certain point of view, if one is a vector full of one (optimized at
compile time), we have the following equivalences :

-> reduce<OP>(lhs) uses the same kernel as inner_prod(lhs,one_vector),
except that the reduction operator is OP and not ADD.
-> reduce_rows<OP>(mat) uses the same kernel as prod(mat,one_vector),
except that the reduction operator is OP and not ADD,.
-> similarly, reduce_cols<OP>(mat) uses the same kernel as
prod(trans(mat),one_vector);

While there is a slight conceptual difference in the kernels (the gemv
kernel has to take care of the reuse of the vector data, the reduce kernel
doesn't), they do show very strong similarities... I see two options here:

(1) - Ignore that slight conceptual difference, and use the same
kernel/backend. This makes sense imho, because the reuse of the vector data
don't matter a lot (it's orders of magnitude smaller in memory than the
matrix). We delegate reduce_impl<OP>(vec) to
inner_prod_impl<OP=AddType>(vec, one_vector())

(2) - Have a specific reduce_impl<>, reduce_rows_impl<>,
reduce_cols_impl<>. I am clearly against this, which would lead to a lot of
duplication for not so much, but well I bring it up for the sake of
Descartes' systematic doubt :)


Best regards,
Philippe
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to