-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Refactor linear algebra module and remove unused code #195
Open
ulises-jeremias
wants to merge
41
commits into
main
Choose a base branch
from
feature/new-lapack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
6f4fe35
Refactor linear algebra module and remove unused code
ulises-jeremias d667c95
Update installation instructions for LAPACK-OpenBLAS
ulises-jeremias 10eea19
Update imports and function signatures in lapack and blas modules
ulises-jeremias 5bd805c
Update import statements in lapack module
ulises-jeremias f33a31b
Update LAPACKE backend status in README.md
ulises-jeremias 3a0af32
Refactor LAPACKE backend for improved performance
ulises-jeremias 11ed075
Refactor README files for BLAS and LAPACK backends
ulises-jeremias c3d1e2e
Refactor conversion functions to be public
ulises-jeremias ea376ac
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias c7356d7
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias 0832f6d
Refactor dgetrf function to use blocked algorithm
ulises-jeremias ae0628b
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias 2a2e7d8
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias e82bda8
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias 88776da
Refactor dgetrf function to use blocked algorithm
ulises-jeremias b84f2ba
Refactor dgetrf function to use blocked algorithm and fix variable na…
ulises-jeremias ab34e62
Refactor LAPACK functions to use row-major memory layout
ulises-jeremias 14d3f67
Refactor LAPACK module to use lapack64 module
ulises-jeremias 02da167
Refactor dgetrs function to use f64 instead of float64 for array types
ulises-jeremias b2f481c
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias e43bfa5
refactor: Update create_image_2d function to use local variable for f…
ulises-jeremias bfa6907
refactor: Replace constant lookup with a list of constants in ilaenv.v
ulises-jeremias 961475e
refactor: Update create_image_2d function to use local variable for f…
ulises-jeremias f6cb782
refactor: Update execute tests step in ci.yml to use Pure C Backend w…
ulises-jeremias 569a96b
refactor: Comment out test execution step in ci.yml
ulises-jeremias d8a4fc2
refactor: Update create_image_2d function to use local variable for f…
ulises-jeremias c66401f
refactor: Update gemv_test.v to use named arguments in dgemvcomp calls
ulises-jeremias d399e1a
refactor: Update gemv_test.v to use named arguments in dgemvcomp calls
ulises-jeremias 1d5e441
refactor: Update gemv_test.v to use named arguments in dgemvcomp calls
ulises-jeremias 9f46519
refactor: Update conversions.v, dgetf2.v, dsyev.v, and lapack_notd_vs…
ulises-jeremias d376d36
refactor: Update dlansy.v to use named constants for error messages
ulises-jeremias 99a3a2b
refactor: Update dpotrf function in lapack_notd_vsl_lapack_lapacke.v …
ulises-jeremias 5f9a1fe
refactor: Update conversions.v, dgetf2.v, dsyev.v, and lapack_notd_vs…
ulises-jeremias e83de29
refactor: Update LAPACK functions in lapack_notd_vsl_lapack_lapacke.v…
ulises-jeremias b06e436
refactor: Update ci.yml to execute tests using Pure V Backend
ulises-jeremias 36ae80e
refactor: Update ci.yml to execute tests using Pure V Backend with CB…
ulises-jeremias 63adcf6
refactor: Update ci.yml to execute tests using Pure V Backend with CB…
ulises-jeremias 8afd14a
refactor: Update dpotrf function to use named constant for uplo param…
ulises-jeremias 3af89bf
refactor: Update BLAS and LAPACK functions to use named constants and…
ulises-jeremias d9fd254
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias 79d8a8d
Merge branch 'main' of github.com:vlang/vsl into feature/new-lapack
ulises-jeremias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# The V Basic Linear Algebra System | ||
|
||
This package implements Basic Linear Algebra System (BLAS) routines in V. | ||
|
||
| Backend | Description | Status | Compilation Flags | | ||
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ------------------- | | ||
| BLAS | Pure V implementation | Stable | `NONE` | | ||
| OpenBLAS | OpenBLAS is an optimized BLAS library based on <https://github.com/xianyi/OpenBLAS>. Check the section [OpenBLAS Backend](#openblas-backend) for more information. | Stable | `-d vsl_blas_cblas` | | ||
|
||
Therefore, its routines are a little more _lower level_ than the ones in the package `vsl.la`. | ||
|
||
## OpenBLAS Backend | ||
|
||
We provide a backend for the OpenBLAS library. This backend is probably | ||
the fastest one for all platforms | ||
but it requires the installation of the OpenBLAS library. | ||
|
||
Use the compilation flag `-d vsl_blas_cblas` to use the OpenBLAS backend | ||
instead of the pure V implementation | ||
and make sure that the OpenBLAS library is installed in your system. | ||
|
||
Check the section below for more information about installing the OpenBLAS library. | ||
|
||
<details> | ||
<summary>Install dependencies</summary> | ||
|
||
### Homebrew (macOS) | ||
|
||
```sh | ||
brew install openblas | ||
``` | ||
|
||
### Debian/Ubuntu GNU Linux | ||
|
||
`libopenblas-dev` is not needed when using the pure V backend. | ||
|
||
```sh | ||
sudo apt-get install -y --no-install-recommends \ | ||
gcc \ | ||
gfortran \ | ||
libopenblas-dev | ||
``` | ||
|
||
### Arch Linux/Manjaro GNU Linux | ||
|
||
The best way of installing OpenBlas is using | ||
[lapack-openblas](https://aur.archlinux.org/packages/lapack-openblas/). | ||
|
||
```sh | ||
yay -S lapack-openblas | ||
``` | ||
|
||
or | ||
|
||
```sh | ||
git clone https://aur.archlinux.org/lapack-openblas.git /tmp/lapack-openblas | ||
cd /tmp/lapack-openblas | ||
makepkg -si | ||
``` | ||
|
||
</details> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module blas64 | ||
|
||
// MemoryLayout is used to specify the memory layout of a matrix. | ||
pub enum MemoryLayout { | ||
row_major = 101 | ||
col_major = 102 | ||
} | ||
|
||
// Transpose is used to specify the transposition of a matrix. | ||
pub enum Transpose { | ||
no_trans = 111 | ||
trans = 112 | ||
conj_trans = 113 | ||
conj_no_trans = 114 | ||
} | ||
|
||
// Uplo is used to specify whether the upper or lower triangle of a matrix is | ||
pub enum Uplo { | ||
upper = 121 | ||
lower = 122 | ||
} | ||
|
||
// Diagonal is used to specify whether the diagonal of a matrix is unit or non-unit. | ||
pub enum Diagonal { | ||
non_unit = 131 | ||
unit = 132 | ||
} | ||
|
||
// Side is used to specify whether a matrix is on the left or right side in a matrix-matrix multiplication. | ||
pub enum Side { | ||
left = 141 | ||
right = 142 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
// import runtime | ||
import sync | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
import vsl.float.float64 | ||
import math | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
fn test_dgemv_no_trans_1() { | ||
expected := [0.0, 0, 0, 0, 0] | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
import vsl.float.float64 | ||
import math | ||
|
2 changes: 1 addition & 1 deletion
2
vlas/internal/blas/level1f64_ddot.v → blas/blas64/level1f64_ddot.v
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
import vsl.float.float64 | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
import math | ||
import vsl.float.float64 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module blas | ||
module blas64 | ||
|
||
import vsl.float.float64 | ||
import math | ||
|
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding examples for
Side
.To enhance understanding, consider adding examples or more detailed explanations on how the
Side
type is used in operations.Would you like me to add examples or detailed usage documentation for this type?
Clarify documentation for
Side
type.The comment for
Side
should be more detailed to explain its use in matrix-matrix multiplication contexts.Committable suggestion
Tip
Codebase Verification
Ensure All Utility Functions Have Unit Tests
The review comment suggests verifying that all utility functions in
blas/conversions.v
are covered by unit tests. The executed script did not find any test functions inblas/conversions.v
.blas/conversions.v
to ensure their correctness, especially for edge cases like zero-sized matrices.Analysis chain
Review of utility functions for matrix operations.
The utility functions for converting and printing matrices are well-implemented. However, ensure that all functions are covered by unit tests to verify their correctness, especially with edge cases like zero-sized matrices.
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 50
Script:
Length of output: 20332