Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vsipl++] [patch] General dispatch, use BLAS for dot- and matrix-matrix products


  • To: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Subject: Re: [vsipl++] [patch] General dispatch, use BLAS for dot- and matrix-matrix products
  • From: Jules Bergmann <jules@xxxxxxxxxxxxxxxx>
  • Date: Tue, 11 Oct 2005 16:31:55 -0400



Mark Mitchell wrote:
Jules Bergmann wrote:


For dot-product, three implementations are provided: a generic
implementation for all types and blocks, a BLAS implementation for BLAS
types and direct data access blocks, and a BLAS implementation that
specializes handling of a conjugated vector (for cvjdot).  By using the
block type to determine if conjugation is necessary, the expressions
'cvjdot(x, y)' and 'dot(x, conj(y))' are evaluated identically.


That's really, really cool.  The performance numbers look great, too.
Does VSIPL have cvjdot?  If not, we can probably show better performance
than any VSIPL implementation on this code.

Unfortunately :), VSIPL does have cvjdot. It is common enough to justify the special case.

However, there is definitely an productivity/performance advantage to recognizing optimizable sequences without requiring the programmer to a special library function. The programmer doesn't have to remember "oh yeah, I should use cvjdot here". It also allows a wider scope to optimize over (for example, VSIPL has prodt, but no tprod).

Some other potential examples of this:

	General           <=> Special-case library call

	prod(A, trans(B)) <=> prodt(A, B)

	prod(trans(A), B) <=> none

	x * y + z         <=> ma(x, y, z)

Our current dispatch should handle prod(A, trans(B) and prodt(A, B) identically.

				-- Jules