Skip to content

Commit db7ad21

Browse files
committed
Update BLISBLAS.jl
1 parent a5fb3f8 commit db7ad21

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
version:
23-
- '1.8'
23+
- '1.9'
2424
- '1.10'
2525
- 'nightly'
2626
os:

Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ authors = ["Carsten Bauer <[email protected]> and contributors"]
44
version = "0.1.1"
55

66
[deps]
7+
LAPACK32_jll = "17f450c3-bd24-55df-bb84-8c51b4b939e3"
8+
LAPACK_jll = "51474c39-65e3-53ba-86ba-03b1b862ec14"
79
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
810
blis32_jll = "e47b3055-b30e-52b1-9cd4-aea7f6c39f40"
911
blis_jll = "6136c539-28a5-5bf0-87cc-b183200dce32"
1012

1113
[compat]
12-
blis_jll = "1.0"
14+
LAPACK32_jll = "3.12"
15+
LAPACK_jll = "3.12"
1316
blis32_jll = "1.0"
17+
blis_jll = "1.0"
1418
julia = "1.9"
1519

1620
[extras]

src/BLISBLAS.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
module BLISBLAS
22

3-
using blis32_jll
4-
using blis_jll
3+
using blis32_jll, LAPACK32_jll
4+
using blis_jll, LAPACK_jll
55
using LinearAlgebra
66

77
function get_num_threads()
88
ret = @ccall blis.bli_thread_get_num_threads()::Cint
99
ret == -1 && throw(ErrorException("return value was -1"))
10+
ret = @ccall blis32.bli_thread_get_num_threads()::Cint
11+
ret == -1 && throw(ErrorException("return value was -1"))
1012
return ret
1113
end
1214

1315
function set_num_threads(nthreads)
1416
ret = @ccall blis.bli_thread_set_num_threads(nthreads::Cint)::Cvoid
1517
ret == -1 && throw(ErrorException("return value was -1"))
18+
ret = @ccall blis32.bli_thread_set_num_threads(nthreads::Cint)::Cvoid
19+
ret == -1 && throw(ErrorException("return value was -1"))
1620
return nothing
1721
end
1822

1923
function __init__()
20-
if blis32_jll.is_available()
21-
BLAS.lbt_forward(blis32, clear=false)
22-
else
23-
@warn("blis32_jll artifact doesn't seem to be available for your platform!")
24-
end
25-
if blis_jll.is_available()
26-
BLAS.lbt_forward(blis, clear=false)
24+
blis_available = blis32_jll.is_available() && blis_jll.is_available()
25+
if blis_available
26+
BLAS.lbt_forward(blis32, clear=true)
27+
BLAS.lbt_forward(liblapack32)
28+
BLAS.lbt_forward(blis)
29+
BLAS.lbt_forward(liblapack)
2730
else
28-
@warn("blis_jll artifact doesn't seem to be available for your platform!")
31+
@warn("The artifacts blis_jll and blis32_jll are not available for your platform!")
2932
end
3033
end
3134

test/runtests.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ using Libdl
55

66
function blas()
77
libs = BLAS.get_config().loaded_libs
8-
lib = lowercase(basename(last(libs).libname))
9-
if contains(lib, "openblas")
8+
libs = map(lib -> lowercase(basename(lib.libname)), libs)
9+
if mapreduce(lib -> contains(lib, "openblas"), |, libs)
1010
return :openblas
11-
elseif contains(lib, "blis")
11+
elseif mapreduce(lib -> contains(lib, "blis"), |, libs)
1212
return :blis
1313
else
1414
return :unknown
@@ -33,8 +33,11 @@ end
3333
end
3434

3535
@testset "BLAS" begin
36-
# run all BLAS tests of the LinearAlgebra stdlib (i.e. LinearAlgebra/test/blas.jl)
36+
# run all BLAS and LAPACK tests of the LinearAlgebra stdlib:
37+
# - LinearAlgebra/test/blas.jl
38+
# - LinearAlgebra/test/lapack.jl
3739
linalg_stdlib_test_path = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
38-
include(joinpath(linalg_stdlib_test_path, "blas.jl"))
40+
joinpath(linalg_stdlib_test_path, "blas.jl") |> include
41+
joinpath(linalg_stdlib_test_path, "lapack.jl") |> include
3942
end
4043
end

0 commit comments

Comments
 (0)