Repository navigation
Check the FMA requirement of libsparseir at load (#164) - #170
Merged
Merged
Conversation
…cks it __init__ calls spir_build_uses_fma and spir_cpu_has_fma (sparse-ir-rs#332) before anything in the library runs, and throws a SparseIRError naming the requirement and the -fma local build instead of dying with SIGILL. A library without the two symbols (every JLL up to now) is not checked. The README states the requirement and the workaround. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #164, following SpM-lab/sparse-ir-rs#350 (which adds
spir_build_uses_fma/spir_cpu_has_fma).__init__calls the two functions throughLibdl.dlsym_ebefore the BLAS backend is set up. If the library uses FMA and the CPU lacks it, it throws aSparseIRErrornaming the requirement and the local-fmabuild, instead of the process dying with SIGILL.libsparseir_jllreleased so far) is not checked, so this is safe to merge before the JLL that has them.RUSTFLAGS="-C target-feature=-fma" julia -e 'using Pkg; Pkg.build("SparseIR")'.test/spir/cpu_tests.jl: the decision for all four combinations, and the check on the loaded library.Local:
Pkg.test()56/56 items, 17734 passes (Julia 1.12.5, current JLL).#164 stays open until the JLL with the check is released and the compat is bumped (its documentation and JLL-flavour items belong to that release).
🤖 Generated with Claude Code