Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need uniform LAPACK Encapsulation for Better Maintainability #5911

Open
Cstandardlib opened this issue Feb 20, 2025 · 2 comments
Open

Need uniform LAPACK Encapsulation for Better Maintainability #5911

Cstandardlib opened this issue Feb 20, 2025 · 2 comments

Comments

@Cstandardlib
Copy link
Collaborator

Cstandardlib commented Feb 20, 2025

Describe the Code Quality Issue

Description

Currently, the software package has a two-layer encapsulation for LAPACK functionalities:

Heterogeneous Encapsulation (CPU/GPU): Different implementations are provided for CPU and GPU.

Multi-Precision Encapsulation (float/double/complex): Separate implementations exist for different precision levels (single-precision, double-precision, and complex numbers).

This dual-layer encapsulation leads to significant maintenance challenges, as changes or updates need to be propagated across multiple implementations, increasing the risk of inconsistencies and bugs.

See: so many different implementation actually doing the same things.
lapack_connector.hx2 & lapack_wrapper.h - Multi-Precision Encapsulation
lapack.h - Heterogeneous Encapsulation

Image

Proposed Solution

To improve maintainability and reduce redundancy, I suggest refactoring the LAPACK encapsulation similar to the BLAS encapsulation. Specifically, we should consolidate all LAPACK functionalities into a single module, such as module_base/lapack_connector. This module would:

Provide a unified interface for both CPU and GPU implementations.

Handle multi-precision (float, double, complex) through a single, consistent API.

Benefits

Easier Maintenance: A single module reduces the complexity of managing multiple implementations.

Consistency: Unified interfaces ensure consistent behavior across different precision levels and hardware backends.

Scalability: Future additions or modifications can be implemented more efficiently.

@Cstandardlib
Copy link
Collaborator Author

@Critsium-xy Any comments?

@Critsium-xy
Copy link
Collaborator

I will do it later. Maybe next week?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants