Skip to content

Commit 91e21e3

Browse files
committed
Update BLISBLAS.jl
1 parent a7fca4a commit 91e21e3

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- os: macOS-latest
3131
arch: aarch64
3232
version: '1'
33-
33+
3434
steps:
3535
- uses: actions/checkout@v5
3636
- uses: julia-actions/setup-julia@v2

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.2.0"
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 = "2"
1314
blis32_jll = "2"
15+
blis_jll = "2""
16+
LAPACK32_jll = "3.12"
17+
LAPACK_jll = "3.12"
1418
julia = "1.12"
1519

1620
[extras]

src/BLISBLAS.jl

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
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)
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)
2230
else
31+
<<<<<<< HEAD
2332
@warn("blis32_jll artifact doesn't seem to be available for your platform!")
2433
end
2534
if blis_jll.is_available()
2635
BLAS.lbt_forward(blis, clear=true)
2736
else
2837
@warn("blis_jll artifact doesn't seem to be available for your platform!")
38+
=======
39+
@warn("The artifacts blis_jll and blis32_jll are not available for your platform!")
40+
>>>>>>> db7ad21 (Update BLISBLAS.jl)
2941
end
3042
end
3143

test/runtests.jl

Lines changed: 9 additions & 7 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,9 +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)
37-
#linalg_stdlib_test_path = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
38-
#include(joinpath(linalg_stdlib_test_path, "blas.jl"))
39-
include("./blas.jl")
36+
# run all BLAS and LAPACK tests of the LinearAlgebra stdlib:
37+
# - LinearAlgebra/test/blas.jl
38+
# - LinearAlgebra/test/lapack.jl
39+
linalg_stdlib_test_path = joinpath(dirname(pathof(LinearAlgebra)), "..", "test")
40+
joinpath(linalg_stdlib_test_path, "blas.jl") |> include
41+
joinpath(linalg_stdlib_test_path, "lapack.jl") |> include
4042
end
4143
end

0 commit comments

Comments
 (0)