@@ -88,18 +88,20 @@ function run_test((test_name, test_expected_outputs, expect_success), libblas_na
88
88
end
89
89
90
90
# our tests, written in C, defined in subdirectories in `test/`
91
- dgemm = (" dgemm_test" , (" ||C||^2 is: 24.3384" ,), true )
92
- dgemmt = (" dgemmt_test" , (" ||C||^2 is: 23.2952" ,), true )
93
- sgesv = (" sgesv_test" , (" ||b||^2 is: 3.0000" ,), true )
94
- sgesv_failure = (" sgesv_test" , (" Error: no BLAS/LAPACK library loaded!" ,), false )
95
- sdot = (" sdot_test" , (" C is: 1.9900" ,), true )
91
+ dgemm = (" dgemm_test" , (" ||C||^2 is: 24.3384" ,), true )
92
+ dgemmt = (" dgemmt_test" , (" ||C||^2 is: 23.2952" ,), true )
93
+ dpstrf = (" dpstrf_test" , (" diag(A): 2.2601 1.8067 1.6970 0.4121" ,), true )
94
+ sgesv = (" sgesv_test" , (" ||b||^2 is: 3.0000" ,), true )
95
+ sgesv_failure = (" sgesv_test" , (" Error: no BLAS/LAPACK library loaded!" ,), false )
96
+ sdot = (" sdot_test" , (" C is: 1.9900" ,), true )
96
97
zdotc = (" zdotc_test" , (
97
98
" C (cblas) is: ( 1.4700, 3.8300)" ,
98
99
" C (fortran) is: ( 1.4700, 3.8300)" ,
99
100
), true )
100
101
101
102
# Helper function to run all the tests with the given arguments
102
- function run_all_tests (args... ; tests = [dgemm, dgemmt, sgesv, sdot, zdotc])
103
+ # Does not include `dgemmt` because that's MKL-only
104
+ function run_all_tests (args... ; tests = [dgemm, dpstrf, sgesv, sdot, zdotc])
103
105
for test in tests
104
106
run_test (test, args... )
105
107
end
@@ -112,13 +114,13 @@ if Sys.WORD_SIZE == 64
112
114
end
113
115
openblas_jll_libname = splitext (basename (OpenBLAS_jll. libopenblas_path)[4 : end ])[1 ]
114
116
@testset " Vanilla OpenBLAS_jll ($(openblas_interface) )" begin
115
- run_all_tests (openblas_jll_libname, OpenBLAS_jll. LIBPATH_list, openblas_interface, " " , tests = [dgemm, sgesv, sdot, zdotc] )
117
+ run_all_tests (openblas_jll_libname, OpenBLAS_jll. LIBPATH_list, openblas_interface, " " )
116
118
end
117
119
118
120
# Build version that links against vanilla OpenBLAS32
119
121
@testset " Vanilla OpenBLAS32_jll (LP64)" begin
120
122
# Reverse OpenBLAS32_jll's LIBPATH_list so that we get the right openblas.so
121
- run_all_tests (" openblas" , reverse (OpenBLAS32_jll. LIBPATH_list), :LP64 , " " , tests = [dgemm, sgesv, sdot, zdotc] )
123
+ run_all_tests (" openblas" , reverse (OpenBLAS32_jll. LIBPATH_list), :LP64 , " " )
122
124
end
123
125
124
126
# Next, build a version that links against `libblastrampoline`, and tell
@@ -128,28 +130,28 @@ lbt_dir = joinpath(lbt_dir, binlib)
128
130
129
131
@testset " LBT -> OpenBLAS_jll ($(openblas_interface) )" begin
130
132
libdirs = unique (vcat (lbt_dir, OpenBLAS_jll. LIBPATH_list... , CompilerSupportLibraries_jll. LIBPATH_list... ))
131
- run_all_tests (blastrampoline_link_name (), libdirs, openblas_interface, OpenBLAS_jll. libopenblas_path, tests = [dgemm, sgesv, sdot, zdotc] )
133
+ run_all_tests (blastrampoline_link_name (), libdirs, openblas_interface, OpenBLAS_jll. libopenblas_path)
132
134
end
133
135
134
136
# And again, but this time with OpenBLAS32_jll
135
137
@testset " LBT -> OpenBLAS32_jll (LP64)" begin
136
138
libdirs = unique (vcat (lbt_dir, OpenBLAS32_jll. LIBPATH_list... , CompilerSupportLibraries_jll. LIBPATH_list... ))
137
- run_all_tests (blastrampoline_link_name (), libdirs, :LP64 , OpenBLAS32_jll. libopenblas_path, tests = [dgemm, sgesv, sdot, zdotc] )
139
+ run_all_tests (blastrampoline_link_name (), libdirs, :LP64 , OpenBLAS32_jll. libopenblas_path)
138
140
end
139
141
140
142
# Test against MKL_jll using `libmkl_rt`, which is :LP64 by default
141
143
if MKL_jll. is_available ()
142
144
@testset " LBT -> MKL_jll (LP64)" begin
143
145
libdirs = unique (vcat (lbt_dir, MKL_jll. LIBPATH_list... , CompilerSupportLibraries_jll. LIBPATH_list... ))
144
- run_all_tests (blastrampoline_link_name (), libdirs, :LP64 , MKL_jll. libmkl_rt_path)
146
+ run_all_tests (blastrampoline_link_name (), libdirs, :LP64 , MKL_jll. libmkl_rt_path; tests = [dgemm, dgemmt, dpstrf, sgesv, sdot, zdotc] )
145
147
end
146
148
147
149
# Test that we can set MKL's interface via an environment variable to select ILP64, and LBT detects it properly
148
150
if Sys. WORD_SIZE == 64
149
151
@testset " LBT -> MKL_jll (ILP64, via env)" begin
150
152
withenv (" MKL_INTERFACE_LAYER" => " ILP64" ) do
151
153
libdirs = unique (vcat (lbt_dir, MKL_jll. LIBPATH_list... , CompilerSupportLibraries_jll. LIBPATH_list... ))
152
- run_all_tests (blastrampoline_link_name (), libdirs, :ILP64 , MKL_jll. libmkl_rt_path)
154
+ run_all_tests (blastrampoline_link_name (), libdirs, :ILP64 , MKL_jll. libmkl_rt_path; tests = [dgemm, dgemmt, dpstrf, sgesv, sdot, zdotc] )
153
155
end
154
156
end
155
157
end
@@ -168,7 +170,7 @@ if dlopen_e(veclib_blas_path) != C_NULL
168
170
# With LAPACK as well, run all tests except `dgemmt`
169
171
veclib_lapack_path = " /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/libLAPACK.dylib"
170
172
@testset " LBT -> vecLib/libLAPACK" begin
171
- run_all_tests (blastrampoline_link_name (), [lbt_dir], :LP64 , string (veclib_blas_path, " ;" , veclib_lapack_path), tests = [dgemm, sgesv, sdot, zdotc] )
173
+ run_all_tests (blastrampoline_link_name (), [lbt_dir], :LP64 , string (veclib_blas_path, " ;" , veclib_lapack_path))
172
174
end
173
175
174
176
veclib_lapack_handle = dlopen (veclib_lapack_path)
@@ -180,7 +182,9 @@ if dlopen_e(veclib_blas_path) != C_NULL
180
182
181
183
@testset " LBT -> vecLib/libLAPACK (ILP64)" begin
182
184
veclib_lapack_path_ilp64 = " $(veclib_lapack_path) !\x 1a\$ NEWLAPACK\$ ILP64"
183
- run_all_tests (blastrampoline_link_name (), [lbt_dir], :ILP64 , veclib_lapack_path_ilp64; tests= [dgemm, sgesv, sdot, zdotc])
185
+ @warn (" dpstrf test broken on new LAPACK in Accelerate" )
186
+ dpstrf_broken = (dpstrf[1 ], " diag(A): 2.2601 1.7140 0.6206 1.1878" , true )
187
+ run_all_tests (blastrampoline_link_name (), [lbt_dir], :ILP64 , veclib_lapack_path_ilp64; tests= [dgemm, dpstrf_broken, sgesv, sdot, zdotc])
184
188
end
185
189
end
186
190
end
0 commit comments