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

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- How to multiply each row of matrix by a single column in CBLAS

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

Pinkerton__James

Beginner

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

02-24-2018
01:04 AM

21 Views

How to multiply each row of matrix by a single column in CBLAS

I'd like to do the following in CBLAS:

static float a[max_i][max_j]; static float b[max_i][max_j]; static float vec[max_i]; for (size_t i = 0; i < max_i; i++) { for (size_t j = 0; j < max_j; j++) { b+= vec * a; } }

Is there a single performant function that I can use to do this whole thing (assuming I alter the 2d arrays to be 1d arrays)? I know I can do this with a for loop of cblas_saxpy's.

Thanks!

Link Copied

1 Reply

Ying_H_Intel

Employee

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

02-27-2018
11:50 PM

21 Views

It seems no one blas function can do this. Maybe you can take vec* as diagonal element of one matrix, other as 0, then call gemm. B=A*V+B
Best Regards,
Ying*

- 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.