From e7b4420bf4ec831fb87a3771a6d2b01b53df17a3 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Wed, 15 Oct 2025 15:48:52 -0500 Subject: [PATCH 1/2] Update Update BLISBLAS.jl --- .github/workflows/CI.yml | 2 +- Project.toml | 6 ++++++ src/BLISBLAS.jl | 17 +++++++++++++---- test/runtests.jl | 16 +++++++++------- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9735a66..e8cfa0b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,7 +30,7 @@ jobs: - os: macOS-latest arch: aarch64 version: '1' - + steps: - uses: actions/checkout@v5 - uses: julia-actions/setup-julia@v2 diff --git a/Project.toml b/Project.toml index bacc3d6..b94ec9b 100644 --- a/Project.toml +++ b/Project.toml @@ -4,11 +4,17 @@ authors = ["Carsten Bauer and contributors"] version = "0.2.0" [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] +blis32_jll = "2" blis_jll = "2" +LAPACK32_jll = "3.12" +LAPACK_jll = "3.12" julia = "1.12" [extras] diff --git a/src/BLISBLAS.jl b/src/BLISBLAS.jl index a6faffc..a1bdaee 100644 --- a/src/BLISBLAS.jl +++ b/src/BLISBLAS.jl @@ -1,25 +1,34 @@ module BLISBLAS -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 blis_jll.is_available() - BLAS.lbt_forward(blis, clear=true) + 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 23425e7..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,9 +33,11 @@ end end @testset "BLAS" begin - # run all BLAS tests of the LinearAlgebra stdlib (i.e. LinearAlgebra/test/blas.jl) - #linalg_stdlib_test_path = joinpath(dirname(pathof(LinearAlgebra)), "..", "test") - #include(joinpath(linalg_stdlib_test_path, "blas.jl")) - include("./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") + joinpath(linalg_stdlib_test_path, "blas.jl") |> include + joinpath(linalg_stdlib_test_path, "lapack.jl") |> include end end From 7ca0b95dbc9261d17f869d2fc2ef330477954b47 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Thu, 16 Oct 2025 13:09:44 -0400 Subject: [PATCH 2/2] Update src/BLISBLAS.jl Co-authored-by: Ian McInerney --- src/BLISBLAS.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BLISBLAS.jl b/src/BLISBLAS.jl index a1bdaee..e09b676 100644 --- a/src/BLISBLAS.jl +++ b/src/BLISBLAS.jl @@ -25,8 +25,8 @@ function __init__() if blis_available BLAS.lbt_forward(blis32, clear=true) BLAS.lbt_forward(liblapack32) - BLAS.lbt_forward(blis) - BLAS.lbt_forward(liblapack) + BLAS.lbt_forward(blis, suffix_hint="64_") + BLAS.lbt_forward(liblapack, suffix_hint="64_") else @warn("The artifacts blis_jll and blis32_jll are not available for your platform!") end