Skip to content

Commit 81730b9

Browse files
amontoisonstaticfloat
authored andcommitted
Add tests with reference BLAS and LAPACK
1 parent eaf1c3a commit 81730b9

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ These BLAS libraries are known to work with libblastrampoline (successfully test
1313
5. Fujitsu BLAS (use in Julia through [FujitsuBLAS.jl](https://github.com/giordano/FujitsuBLAS.jl))
1414
6. [ARMPL BLAS](https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Libraries)
1515
7. [NVPL BLAS](https://docs.nvidia.com/nvpl/_static/blas/)
16+
8. [Reference BLAS and LAPACK](https://github.com/Reference-LAPACK/lapack)
1617

1718
## Basic usage
1819

test/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
[deps]
22
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
33
CompilerSupportLibraries_jll = "e66e0078-7015-5450-92f7-15fbd957f2ae"
4+
LAPACK32_jll = "17f450c3-bd24-55df-bb84-8c51b4b939e3"
5+
LAPACK_jll = "51474c39-65e3-53ba-86ba-03b1b862ec14"
46
MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7"
57
OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2"
68
OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363"
9+
ReferenceBLAS32_jll = "9e84b91c-71b0-5f24-acdc-49dbe8049396"
10+
ReferenceBLAS_jll = "ee697234-451c-51c9-b102-303d89a9c3a0"
711

812
# Force an old version of OpenBLAS32_jll so that it's missing some newer symbols
913
[compat]

test/dpstrf_test/dpstrf_test.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ int main()
4141
// return value
4242
MANGLE(dpstrf_)("U", &order, &A[0][0], &lda, &pivot[0], &rank, &tol, &work[0], &info);
4343
if (info != 0) {
44-
printf("ERROR: info == %ld!\n", info);
44+
#ifdef ILP64
45+
printf("ERROR: info == %ld!\n", info);
46+
#else
47+
printf("ERROR: info == %d!\n", info);
48+
#endif
4549
return 1;
4650
}
4751

test/runtests.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using OpenBLAS_jll, OpenBLAS32_jll, MKL_jll, CompilerSupportLibraries_jll
2+
using ReferenceBLAS32_jll, LAPACK32_jll, ReferenceBLAS_jll, LAPACK_jll
23
using Pkg, Artifacts, Base.BinaryPlatforms, Libdl, Test
34

45
include("utils.jl")
@@ -124,6 +125,14 @@ end
124125
run_all_tests("openblas", reverse(OpenBLAS32_jll.LIBPATH_list), :LP64, "")
125126
end
126127

128+
@testset "Vanilla ReferenceBLAS32_jll (LP64)" begin
129+
run_all_tests("blas32", reverse(ReferenceBLAS32_jll.LIBPATH_list), :LP64, "", tests = [dgemm, sdot])
130+
end
131+
132+
@testset "Vanilla ReferenceBLAS_jll (ILP64)" begin
133+
run_all_tests("blas", reverse(ReferenceBLAS_jll.LIBPATH_list), :ILP64, "", tests = [dgemm, sdot])
134+
end
135+
127136
# Next, build a version that links against `libblastrampoline`, and tell
128137
# the trampoline to forwards calls to `OpenBLAS_jll`
129138
lbt_link_name, lbt_dir = build_libblastrampoline()
@@ -170,6 +179,16 @@ end
170179
end
171180
end
172181

182+
@testset "LBT -> ReferenceBLAS32_jll / LAPACK32_jll (LP64)" begin
183+
libdirs = unique(vcat(lbt_dir, ReferenceBLAS32_jll.LIBPATH_list..., LAPACK32_jll.LIBPATH_list..., CompilerSupportLibraries_jll.LIBPATH_list...))
184+
run_all_tests(blastrampoline_link_name(), libdirs, :LP64, string(ReferenceBLAS32_jll.libblas32_path, ";", LAPACK32_jll.liblapack32_path); tests = [dgemm, dpstrf, sgesv, sdot])
185+
end
186+
187+
# @testset "LBT -> ReferenceBLAS_jll / LAPACK_jll (ILP64)" begin
188+
# libdirs = unique(vcat(lbt_dir, ReferenceBLAS_jll.LIBPATH_list..., LAPACK_jll.LIBPATH_list..., CompilerSupportLibraries_jll.LIBPATH_list...))
189+
# run_all_tests(blastrampoline_link_name(), libdirs, :ILP64, string(ReferenceBLAS_jll.libblas_path, ";", LAPACK_jll.liblapack_path); tests = [dgemm, dpstrf, sgesv, sdot])
190+
# end
191+
173192
# Test against MKL_jll using `libmkl_rt`, which is :LP64 by default
174193
if MKL_jll.is_available()
175194
# On i686, we can't do complex return style autodetection, so we manually set it,

0 commit comments

Comments
 (0)