diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 18bb9b3..06159fc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: version: - - '1.8' + - '1.9' - '1.10' - 'nightly' os: diff --git a/Project.toml b/Project.toml index ab7f09e..5dd7039 100644 --- a/Project.toml +++ b/Project.toml @@ -4,13 +4,17 @@ authors = ["Carsten Bauer and contributors"] version = "0.1.1" [deps] +LAPACK32_jll = "17f450c3-bd24-55df-bb84-8c51b4b939e3" +LAPACK_jll = "51474c39-65e3-53ba-86ba-03b1b862ec14" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" blis32_jll = "e47b3055-b30e-52b1-9cd4-aea7f6c39f40" blis_jll = "6136c539-28a5-5bf0-87cc-b183200dce32" [compat] -blis_jll = "1.0" +LAPACK32_jll = "3.12" +LAPACK_jll = "3.12" blis32_jll = "1.0" +blis_jll = "1.0" julia = "1.9" [extras] diff --git a/src/BLISBLAS.jl b/src/BLISBLAS.jl index 45e2393..a1bdaee 100644 --- a/src/BLISBLAS.jl +++ b/src/BLISBLAS.jl @@ -1,31 +1,34 @@ module BLISBLAS -using blis32_jll -using blis_jll +using blis32_jll, LAPACK32_jll +using blis_jll, LAPACK_jll using LinearAlgebra function get_num_threads() ret = @ccall blis.bli_thread_get_num_threads()::Cint ret == -1 && throw(ErrorException("return value was -1")) + ret = @ccall blis32.bli_thread_get_num_threads()::Cint + ret == -1 && throw(ErrorException("return value was -1")) return ret end function set_num_threads(nthreads) ret = @ccall blis.bli_thread_set_num_threads(nthreads::Cint)::Cvoid ret == -1 && throw(ErrorException("return value was -1")) + ret = @ccall blis32.bli_thread_set_num_threads(nthreads::Cint)::Cvoid + ret == -1 && throw(ErrorException("return value was -1")) return nothing end function __init__() - if blis32_jll.is_available() - BLAS.lbt_forward(blis32, clear=false) - else - @warn("blis32_jll artifact doesn't seem to be available for your platform!") - end - if blis_jll.is_available() - BLAS.lbt_forward(blis, clear=false) + blis_available = blis32_jll.is_available() && blis_jll.is_available() + if blis_available + BLAS.lbt_forward(blis32, clear=true) + BLAS.lbt_forward(liblapack32) + BLAS.lbt_forward(blis) + BLAS.lbt_forward(liblapack) else - @warn("blis_jll artifact doesn't seem to be available for your platform!") + @warn("The artifacts blis_jll and blis32_jll are not available for your platform!") end end diff --git a/test/runtests.jl b/test/runtests.jl index 6cd7af5..3d6ceb1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,10 +5,10 @@ using Libdl function blas() libs = BLAS.get_config().loaded_libs - lib = lowercase(basename(last(libs).libname)) - if contains(lib, "openblas") + libs = map(lib -> lowercase(basename(lib.libname)), libs) + if mapreduce(lib -> contains(lib, "openblas"), |, libs) return :openblas - elseif contains(lib, "blis") + elseif mapreduce(lib -> contains(lib, "blis"), |, libs) return :blis else return :unknown @@ -33,8 +33,11 @@ end end @testset "BLAS" begin - # run all BLAS tests of the LinearAlgebra stdlib (i.e. LinearAlgebra/test/blas.jl) + # run all BLAS and LAPACK tests of the LinearAlgebra stdlib: + # - LinearAlgebra/test/blas.jl + # - LinearAlgebra/test/lapack.jl linalg_stdlib_test_path = joinpath(dirname(pathof(LinearAlgebra)), "..", "test") - include(joinpath(linalg_stdlib_test_path, "blas.jl")) + joinpath(linalg_stdlib_test_path, "blas.jl") |> include + joinpath(linalg_stdlib_test_path, "lapack.jl") |> include end end