Merged
Conversation
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.
🎩 What is the goal?
This PR implements the missing
dgeev_(double-precision eigenvalue decomposition) function for WASM/WASI platform. The CLAPACK library used on WASM doesn't includedgeev_, so a pure Swift implementation using the QR algorithm was developed. This enables eigenvalue decomposition functionality on WASM, which was previously throwing a fatal error.Additionally, this PR improves the CLAPACK wrapper layer by introducing a CLAPACKHelper C module that properly handles the ABI mismatch between CLAPACK's header declarations (returning
int) and the actual f2c-generated implementation (returningvoid).📄 How is it being implemented?
Pure Swift Eigenvalue Decomposition (
swiftEigenDecomposition):_eigenHessenbergReduction)_eigenQRStep)_eigenExtractEigenvalues)_eigenComputeEigenvectors)CLAPACKHelper Module:
Sources/CLAPACKHelper/) that provides correct function signaturesclapack_dgetrf_wrapper,clapack_dgetri_wrapper) that call CLAPACK with proper void return typeWASM-compatible dgeev_ wrapper:
dgeev_function on WASM now delegates to the pure Swift implementationTest Coverage Updates:
LinAlgTest.swiftto conditionally run tests based on platform capabilitiesWASIFallbackTests.swiftfor:swiftEigenDecompositionfunction