File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ Standard library changes
5858
5959#### LinearAlgebra
6060
61+ * A new unexported function ` BLAS.with_num_threads ` allows you to temporarily change the number of
62+ BLAS threads. ([ #41785 ] )
63+
6164#### Markdown
6265
6366#### Printf
Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ Set the number of threads the BLAS library should use equal to `n::Integer`.
120120
121121Also accepts `nothing`, in which case julia tries to guess the default number of threads.
122122Passing `nothing` is discouraged and mainly exists for historical reasons.
123+
124+ See also [`with_num_threads`](@ref BLAS.with_num_threads) to temporarily change
125+ number of BLAS threads.
123126"""
124127set_num_threads (nt:: Integer ):: Nothing = lbt_set_num_threads (Int32 (nt))
125128function set_num_threads (:: Nothing )
@@ -168,7 +171,7 @@ restore to previous threads setting.
168171
169172# Example
170173
171- The result differs on different machines.
174+ Depending on the number of available CPU cores, the result can be different:
172175
173176```julia
174177julia> BLAS.get_num_threads()
@@ -188,6 +191,9 @@ julia> BLAS.get_num_threads()
188191 This function is not thread safe. If there are multiple
189192 threads calling BLAS routines, then the threads they are
190193 using will also be changed until this function finishes.
194+
195+ See also [`set_num_threads`](@ref BLAS.set_num_threads) to permanently change
196+ number of BLAS threads.
191197"""
192198function with_num_threads (f, num_threads:: Integer )
193199 prev_num_threads = BLAS. get_num_threads ()
You can’t perform that action at this time.
0 commit comments