You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add availability checks for MKL and OpenBLAS similar to AppleAccelerate (#751)
* Add availability checks for MKL and OpenBLAS similar to AppleAccelerate
This commit adds runtime availability checks for MKL and OpenBLAS libraries
to ensure proper error handling when the libraries are not available. The
implementation follows the same pattern as AppleAccelerateLU:
- Added __mkl_isavailable() function to check MKL library availability
- Added __openblas_isavailable() function to check OpenBLAS library availability
- Added error checks in all getrf!, getrs!, and solve! functions
- Uses Libdl to check for library symbols at runtime
This ensures that calls properly compile out when the binaries are missing
and provides clear error messages when the libraries are not available.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Simplify availability checks - remove try/catch and symbol checking
Per review feedback, simplified the availability checks:
- Removed try/catch blocks as they're unnecessary
- Removed Libdl symbol checking - if the binary exists via is_available(), it's fine
- Just check if the JLL module is defined and is_available() returns true
This makes the code cleaner and follows the principle that if the binary
exists, we can trust it has the required symbols.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Use @static if for compile-time availability checks
Changed the availability check functions to use @static if for compile-time
determination, matching the pattern used in AppleAccelerate:
- Uses @static if to check @isdefined at compile time
- Returns is_available() result statically when JLL is defined
- Returns false statically when JLL is not defined
This makes the checks more efficient as they're resolved at compile time
rather than runtime.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
0 commit comments