akielaries / openGPMP

Hardware Accelerated General Purpose Mathematics Package
https://akielaries.github.io/openGPMP/
MIT License
8 stars 3 forks source link

Make use of OpenBLAS/BLAS if available? #115

Open akielaries opened 7 months ago

akielaries commented 7 months ago

There could be some ways to use CMake and preprocessor macros to use OpenBLAS or other BLAS like libraries in the project?

akielaries commented 7 months ago

IIRC OpenBLAS uses multithreading by default via ENV vars. Using the CMake build systems check if OpenBLAS is on the system some how, if it is link against it. Perhaps leave the multithreading option up to the user and their use of OpenBLAS, otherwise not really sure what to do on this...

As far as distinguishing between which routines to use (DGEMM from our linalg module or DGEMM from OpenBLAS, etc) there are a few ways:

  1. Wrappers around this routines that take the same parameters but different internal logic depending on the routine (our DGEMM has 13 params, typical DGEMM has 11?)
  2. Conditional compilation + preprocessor macros
akielaries commented 7 months ago

Included detection and a macro for OpenBLAS but nothing is utilizing it so far. CMake is able to detect available OpenBLAS installations so far