Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrew_Drach
Beginner
119 Views

C++ ?imatcopy

Jump to solution
Hi everyone,
Does anybody know how to use mkl_?imatcopy? I cannot get it working on my system. I use a lot of other MKL routines without a glitch but this one does not do anything :(
I work in MSVC 2008 with MKL 10.2
0 Kudos
1 Solution
Vladimir_Petrov__Int
New Contributor III
119 Views
Andrew,

The root cause of the problem is using Cblas constants instead of the chars ('R' for row-major, and 'N' for no action) as documented in the MKL manual.

Please use
mkl_dimatcopy('R','N',3,3,K,&(D1(0,0)),3,3);
instead of
mkl_dimatcopy(CblasRowMajor,CblasNoTrans,3,3,K,&D1(0,0),3,3);

Best regards,
Vladimir

View solution in original post

7 Replies
Gennady_F_Intel
Moderator
119 Views
Hi krfighter,
in's not clear what do you mean by "but this one does not do anything"?
is that mean the input array == the output one?
--Gennady
Vladimir_Koldakov__I
New Contributor III
119 Views
Hello,
Could you please provide a testcase?
It's not cleare what are you trying to do.
Thanks,
Vladimir
Andrew_Drach
Beginner
119 Views
I am terribly sorry that first post was not clear enough.

Yes, input equals to output for some reason.
Here is an example code:
using namespace boost::numeric::ublas;
double K(3.0);
matrix D1;
D1.resize(3,3);
for (int i=0;i<3;++i) for (int j=0;j<3;++j) D1(i,j)=1.0;
mkl_dimatcopy(CblasRowMajor,CblasNoTrans,3,3,K,&D1(0,0),3,3);

P.S. Is it just me or all MKL developers are Russian? :) !
Vladimir_Petrov__Int
New Contributor III
119 Views
Hello,

My first guess is that you are passing CblasNoTrans to mkl_dimatcopy.

My second thought is that you may be simply scaling...
In this case I wonder what D1 and D2 are in your example?

Best regards,
Vladimir (yet another one)
Andrew_Drach
Beginner
119 Views
Yes, I do not need transposition.
Yes, I thought I could use this procedure for simple scaling (scalar multiplication)

Sorry, it should be D1 in both cases. Already corrected
Vladimir_Petrov__Int
New Contributor III
120 Views
Andrew,

The root cause of the problem is using Cblas constants instead of the chars ('R' for row-major, and 'N' for no action) as documented in the MKL manual.

Please use
mkl_dimatcopy('R','N',3,3,K,&(D1(0,0)),3,3);
instead of
mkl_dimatcopy(CblasRowMajor,CblasNoTrans,3,3,K,&D1(0,0),3,3);

Best regards,
Vladimir

View solution in original post

Andrew_Drach
Beginner
119 Views
Vladimir,

Thanks a lot!
Such a silly mistake to mess it up with CBLAS interface constants...
Reply