Skip to content

Commit 2cd5b21

Browse files
committed
Fix for nthreads == 1 by default
1 parent 95aef37 commit 2cd5b21

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/direct.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,13 @@ end
117117

118118
# get/set threads
119119
nthreads = ccall(dlsym(OpenBLAS32_jll.libopenblas_handle, :openblas_get_num_threads), Cint, ())
120+
@test nthreads > 0
120121
@test lbt_get_num_threads(lbt_handle) == nthreads
121-
nthreads = div(nthreads, 2)
122+
if nthreads <= 1
123+
nthreads = 2
124+
else
125+
nthreads = div(nthreads, 2)
126+
end
122127
lbt_set_num_threads(lbt_handle, nthreads)
123128
@test ccall(dlsym(OpenBLAS32_jll.libopenblas_handle, :openblas_get_num_threads), Cint, ()) == nthreads
124129
@test lbt_get_num_threads(lbt_handle) == nthreads

0 commit comments

Comments
 (0)