Skip to content

Need uniform LAPACK Encapsulation for Better Maintainability #5911

Closed
@Cstandardlib

Description

@Cstandardlib

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.

Metadata

Metadata

Assignees

Labels

GPU & DCU & HPCGPU and DCU and HPC related any issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions