Hi,

 > A couple of months a go we already discussed the introduction of :
> reduce_rows<op_add>(A) vs reduce<op_add>(row_wise(A))
>
> And concluded that the latter option would lead to higher compilation
> times for not so much benefits.
>
> However, the more I think about it, the more I believe that reductions
> should be just internal tools and that we should provide direct
> shortcuts instead:
>
> sum(x), max(x), min(x), argmax(x), argmin(x)
>
> In this case, it would make much more sense to have
>
> sum(row_wise(A)), max(row_wise(A)), etc...

I like this :-) Which operations do we want to support? I think we 
should cover the ones in MPI and OpenMP, i.e.
  min(), max(), sum(), and prod(),
where the latter computes the product of all entries. For integers 
there's also (L/B)AND, (L/B)OR, (L/B)XOR, with L referring to 'logical' 
and 'B' to bitwise. OpenMP seems to allow a reduction with operator '-' 
as well, which is somewhat exotic. What about summing absolute values 
like in norm_1? What about summing squares as in norm_2()? It would be 
nice to have them covered so that we don't need separate implementations 
for the norms.


> rather than
>
> sum_rows, max_rows, etc...
>
> So I think that it could actually make sense to introduce
> {row|col}_wise(). Any thought?

How should row_wise(A) look implementation-wise? We can't make it a 
vector_base, because of the padding of A (there is no range-object which 
hides the zeros). This leaves us with matrix_expression, which is 
probably okay (yet not a beauty), as it allows for easier overloading of 
sum(), max(), etc.

Best regards,
Karli


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to