[vsipl++] [patch] Use new dispatch for matvec functions

Jules Bergmann jules at codesourcery.com
Tue Nov 18 21:38:03 UTC 2008


Don,

>>> -template <typename T,
>>> -          typename Block1,
>>> -          typename Block2>
>>> -struct Evaluator<Op_prod_vv_dot, Return_scalar<std::complex<T> >,
>>> -                 Op_list_2<Block1, -                           
>>> Unary_expr_block<1, conj_functor,
>>> -                                            Block2, std::complex<T> 
>>> > const>,
>>> -                 Cvsip_tag>
>>
>> [2] Why is this evaluator being removed?
>>
> Because, as I understood it, the only time it is invoked is when it is 
> called directly (reference implementation), rather than through the 
> dispatch mechanism, and as such, the Ext_data object would perform the 
> copy needed in order to apply the conjugate functor.
> 
> Now I'm not sure that was correct.  I'll restore the evaluator.  Can you 
> solidify my understanding of how this works though?  Will it not perform 
> the conjugate operation twice as a result of 'b.op()' followed by 
> 'cvjdot()'?

The conjugate is done only once, by the cvjdot routine.

The VSIPL++ expression:

	z = dot(p, conj(q));	// VSIPL++

Gets recognized by the evaluator with

	a = p
	b = conj(q);

Internally, b.op() == q, so it gets evaluated as:

	z = cvjdot(p, q);

b.op() is probably returns the operand block of b.  It doesn't perform 
the operation (the name is a bit confusing in that sense).

				-- Jules





-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705



More information about the vsipl++ mailing list