![]() |
Blitz Support : |
From: Julian C. Cummings (cummings_at_[hidden])
Date: 2004-08-23 15:30:42
Hello Mathias,
I've been on vacation for a while, but as far as I can tell, you did not
receive a response to your e-mail. Without knowing the exact details of how
you construct your Arrays A, B and C, I would guess that you are using the
data() method when you should be using the dataFirst() method. These two
methods differ when one or more Array ranks are not stored in ascending
order (i.e., with order in memory matching logical ordering by array index
values). This can happen when you construct Arrays with explicit Ranges,
depending upon what Range values are used. Typically, you would use
dataFirst() when attempting to pass a raw data pointer to a C function that
is expecting the first Array element in a memory block. You might try
calling isRankStoredAscending(int rank) on your Arrays to determine if this
is an issue for your code.
Regards, Julian C.
Dr. Julian C. Cummings
Staff Scientist, CACR/Caltech
(626) 395-2543
cummings_at_[hidden]
> -----Original Message-----
> From: blitz-support-bounces_at_[hidden]
> [mailto:blitz-support-bounces_at_[hidden]] On Behalf Of
> Mathias Wagner
> Sent: Thursday, August 12, 2004 12:59 AM
> To: blitz-support_at_[hidden]
> Subject: [Blitz-support] GSL / MKL cblass_dgemm matrix multiplication
>
>
> Hi,
>
> has anyone experience with using
>
> BLAS Level 3 function
>
> cblass_dgemm
>
> from GSL or Intel MKL Library with Blitz++?
>
> I use the following code to have a nicer interface
>
> void matmultadd(const blitz::Array<double,2> &A, const
> blitz::Array<double,2> &B, blitz::Array<double,2> &C, double
> alpha, double
> beta){
>
> cblas_dgemm(CblasRowMajor,CblasNoTrans,CblasNoTrans,C.rows(),C
> .columns(),A.columns(),alpha,A.data(),A.columns(),B.data(),B.c
> olumns(),beta,C.data(),C.columns());
> }
>
> In simple cases this works fine. But if I create the matrices
> A,B and C with
> constructs like
>
> A(Range...,Range...) = X(Range...,Range..)
>
> it fails. This does not depend on whether I use GSL or MKL ?
>
> I tried isStorageContinours() for A,B and C and it returns
> true. I also tried the .reference(copy()) tip from the
> manual, but it doesn'y change
> anything?
>
> The MKL Version is about 10 times faster then using 3 for
> loops for matrix
> sizes about 100x100 on my P4 (iusing the Intel Compiler 8.0),
> so I am really
> interested in fixing this.
>
> Mathias
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>