Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Andrew_Drach

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-24-2010
09:51 AM

119 Views

C++ ?imatcopy

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

1 Solution

Vladimir_Petrov__Int

New Contributor III

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-27-2010
12:35 AM

119 Views

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

Link Copied

7 Replies

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-24-2010
10:53 AM

119 Views

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-24-2010
10:53 AM

119 Views

Could you please provide a testcase?

It's not cleare what are you trying to do.

Thanks,

Vladimir

Andrew_Drach

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-25-2010
07:11 PM

119 Views

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);

Vladimir_Petrov__Int

New Contributor III

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-25-2010
08:10 PM

119 Views

My first guess is that you are passing Cblas

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-25-2010
08:55 PM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-27-2010
12:35 AM

120 Views

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

Andrew_Drach

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-29-2010
03:12 AM

119 Views

Vladimir,

Thanks a lot!

Such a silly mistake to mess it up with CBLAS interface constants...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.