Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Algorithms: cgels vs. manual implementation

Cody_H_
Beginner
341 Views

I'm currently working on a project that uses a linear least squares approach to calculate weights for 'n' packets of data. After embedding and testing both the manual and cgels routines I found the manual version to calculate the answer ~57% more quickly for 'n' packets.

The manual version involves many inverses, conjugations, and normlization (all done with the MKL libraries) so I assumed it wouldn't be as quick as the cgels routine. What could be causing this loss in efficiency? My first ideas were constant reallocation memory and error checking, but I'd rather get a second opinion before I finalize the project.

Example:

Applying weights to 750 packets of data in real time (20 seconds). When using the manual routine, the time elapsed is ~11.026 seconds. When using the cgels routine the time is ~17.312 seconds, putting the computation time (+~5 seconds) over the 20 second time interval.

Thank you for your time. Any feedback is appreciated.

0 Kudos
1 Reply
SergeyKostrov
Valued Contributor II
341 Views
>>...After embedding and testing both the manual and cgels routines I found the manual version to calculate >>the answer ~57% more quickly for 'n' packets. Thanks for the report ( really interesting ) and I think many of us will be glad to verify your results. Even if MKL functions are very optimized and universal ( support many instruction sets ) there is a possibility that a smarter solution was implemented in some project in some algorithm. Please provide additional technical details.
0 Kudos
Reply