Skip to content

Commit 72bf2e1

Browse files
carstenbauerclaude
andcommitted
Skip MKL tests when MKL is not loaded (e.g. 32-bit x86) and bump MKL compat
MKL doesn't ship 32-bit binaries, so `using MKL` is a no-op on x86. Guard MKL tests behind `mkl_is_loaded()` check instead of failing. Also bump MKL compat to include 0.9 (subsumes PR #110). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 556900d commit 72bf2e1

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ DelimitedFiles = "1"
2727
Distributed = "1"
2828
Libdl = "1"
2929
LinearAlgebra = "1"
30-
MKL = "0.4, 0.6"
30+
MKL = "0.4, 0.6, 0.9"
3131
MPI = "0.20"
3232
MPIPreferences = "0.1"
3333
PrecompileTools = "1"

test/tests_mkl.jl

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ using ThreadPinning
33
using Test
44
using MKL
55

6-
@testset "MKL utilities" begin
7-
@test ThreadPinning.MKL.mkl_is_loaded()
8-
@test ThreadPinning.MKL.mkl_get_dynamic() isa Integer
9-
@test isnothing(ThreadPinning.MKL.mkl_set_dynamic(1))
10-
@test ThreadPinning.MKL.mkl_get_dynamic() == 1
11-
@test isnothing(ThreadPinning.MKL.mkl_set_dynamic(0))
12-
@test ThreadPinning.MKL.mkl_get_dynamic() == 0
13-
end
6+
if !ThreadPinning.MKL.mkl_is_loaded()
7+
@warn "MKL not loaded (e.g. no MKL binaries on 32-bit), skipping MKL tests."
8+
else
9+
@testset "MKL utilities" begin
10+
@test ThreadPinning.MKL.mkl_is_loaded()
11+
@test ThreadPinning.MKL.mkl_get_dynamic() isa Integer
12+
@test isnothing(ThreadPinning.MKL.mkl_set_dynamic(1))
13+
@test ThreadPinning.MKL.mkl_get_dynamic() == 1
14+
@test isnothing(ThreadPinning.MKL.mkl_set_dynamic(0))
15+
@test ThreadPinning.MKL.mkl_get_dynamic() == 0
16+
end
1417

15-
@testset "MKL threadinfo" begin
16-
@test isnothing(threadinfo())
17-
@test isnothing(threadinfo(; blas = true, hints = true))
18+
@testset "MKL threadinfo" begin
19+
@test isnothing(threadinfo())
20+
@test isnothing(threadinfo(; blas = true, hints = true))
21+
end
1822
end

0 commit comments

Comments
 (0)