Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- c++ Project - where to start?

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

Highlighted
##

Hello,

I'm new to this forum and have just "discovered" IMKL. Up to now I have only used eigen 3 ( http://eigen.tuxfamily.org/index.php?title=Main_Page ), which was really easy to handle, but because of performance issues I had to look for alternatives and I guess the IMKL is a very good library.

Unfortunately I didn't find much information in the manual of the IMKL on how to use it and I have some basic questions:

- I want to start simple, so I guess there is no "Matrix" Class or anything like that in IMKL, so I primarily just call functions - that's it?

- With what kind types do I have to call the IMKL functions - e.g. is a Matrix just a two-dimensional array?

- Can I perform basic math operations on my matrices like deleting rows/columns and so on?

- How are sparse matrices that are compatible to the IMKL defined and can you recommend me maybe a predefined class that I can use?

- Are there any basic c++ examples available? (Didn't find any myself)

Thanks for your help!

matse

matse

Beginner

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

08-02-2011
02:13 PM

10 Views

c++ Project - where to start?

I'm new to this forum and have just "discovered" IMKL. Up to now I have only used eigen 3 ( http://eigen.tuxfamily.org/index.php?title=Main_Page ), which was really easy to handle, but because of performance issues I had to look for alternatives and I guess the IMKL is a very good library.

Unfortunately I didn't find much information in the manual of the IMKL on how to use it and I have some basic questions:

- I want to start simple, so I guess there is no "Matrix" Class or anything like that in IMKL, so I primarily just call functions - that's it?

- With what kind types do I have to call the IMKL functions - e.g. is a Matrix just a two-dimensional array?

- Can I perform basic math operations on my matrices like deleting rows/columns and so on?

- How are sparse matrices that are compatible to the IMKL defined and can you recommend me maybe a predefined class that I can use?

- Are there any basic c++ examples available? (Didn't find any myself)

Thanks for your help!

matse

3 Replies

Highlighted
##

Hi Matse,

Konstantin_A_Intel

Employee

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

08-02-2011
09:24 PM

10 Views

For the moment, MKL is a library providing C/Fortran interfaces only. It means that you can call MKL functions from your C++ program, but MKL doesn't provide any classes to deal with matrices. Instead, it operates with data arrays which represents matrices and other input/output data.

If we talk about dense matrices - they are represented as one-dimensional array (pointer to float/doubles) which stores the matrix in column-major order (column-by-column in memory).

Re sparse matrices MKL provides a variety of standard sparse formats like CSR/CSC/COO etc.

For more details, please refer to online-documentation:

Regards,

Konstantin

Highlighted
##

Hi Konstantin,

thanks for your helpfull reply!

I have just one more question: Do you know c++ libraries that performs just these basic actions (filling matrix, deleting rows / columns of the matrix) so that I can do the rest with MKL?

The thing is I didn't find such a class (couldn't believe it - this should definetly exist already...) and I don't want to write such a basic class if there exists already one that performs good. So do you know what people generally use for creating matrices when working with MKL from c++?

Thanks for your help,

matse

matse

Beginner

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

08-03-2011
06:38 AM

10 Views

thanks for your helpfull reply!

I have just one more question: Do you know c++ libraries that performs just these basic actions (filling matrix, deleting rows / columns of the matrix) so that I can do the rest with MKL?

The thing is I didn't find such a class (couldn't believe it - this should definetly exist already...) and I don't want to write such a basic class if there exists already one that performs good. So do you know what people generally use for creating matrices when working with MKL from c++?

Thanks for your help,

matse

Highlighted
##

Hello everybody,

I just want to make an addition to this thread just in case anybody has the same "question" and finds this thread.

So I've found a really great c++ library, called "Flens", you can find it here:

http://flens.sourceforge.net/index.html

This is exactly what I was looking for, you can create simply (dense and sparse) matrices and it has a nice concept of "viewing" just single parts of a matrix, which is even better in my case then deleting rows / columns completely.

And the intention of the authors is to give a kind of interface to BLAS or MKL, so the matrix types are compatible with it. It even has an implementation of basic functions like vector / matrix multiplication, which calls BLAS/MKL functions under the hood. And you can compile flens directly against MKL so it uses MKL for these implemented functions.

Really great, I think that's a wonderful thing. The tutorial is really nice, the documentation is even better and it's *free* (as in freedom) ;), it's under BSD license.

So enough of this advertising now...

Cheers

matse

matse

Beginner

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

08-04-2011
02:00 PM

10 Views

I just want to make an addition to this thread just in case anybody has the same "question" and finds this thread.

So I've found a really great c++ library, called "Flens", you can find it here:

http://flens.sourceforge.net/index.html

This is exactly what I was looking for, you can create simply (dense and sparse) matrices and it has a nice concept of "viewing" just single parts of a matrix, which is even better in my case then deleting rows / columns completely.

And the intention of the authors is to give a kind of interface to BLAS or MKL, so the matrix types are compatible with it. It even has an implementation of basic functions like vector / matrix multiplication, which calls BLAS/MKL functions under the hood. And you can compile flens directly against MKL so it uses MKL for these implemented functions.

Really great, I think that's a wonderful thing. The tutorial is really nice, the documentation is even better and it's *free* (as in freedom) ;), it's under BSD license.

So enough of this advertising now...

Cheers

matse

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