Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

Compress matrix in CSR Format after matrix multiplication

andrefla
Beginner
551 Views
Hello,
is there an easy way (or a predefined function) to compress a matrix in CSR format after a matrix multiplication?
I have two problems:
a) I have to set the number of non zero elements in advance, but I don't know the exact number of non zero elements after the matrix multiplication. So I have to assume the worst case, which is alway higher than the real one.
b) During matrix multiplication there can be zeros introduced, which enlarges my matrix.
The only way I know is, that I can walk through the values array "by hand", delete all zeros and correct all indices in the corresponding index arrays. But that's really exhausting ...
All the best,
Andr
Edit:
I said nothing. I should read the manual twice: Callmkl_?csrmultcsr first with request=1 and after that with request=2
0 Kudos
1 Reply
Gennady_F_Intel
Moderator
551 Views
Andr,
please look at themkl_ddnscsr(,,,,,) routine which converts dense to the CSR representations when job(1) == 0.
will it appropriate for you?
--Gennady
0 Kudos
Reply