JuliaLang / Compat.jl

Compatibility across Julia versions
Other
145 stars 117 forks source link

Add BLAS.get_num_threads #709

Closed mcabbott closed 4 years ago

mcabbott commented 4 years ago

Ref https://github.com/JuliaLang/julia/pull/36360

Note that I didn't export this, leaving it as Compat.get_num_threads(), but did import the version from LinearAlgebra when defined.

Also, I copied the new version of set_num_threads() here, rather than calling the existing one.

martinholters commented 4 years ago

Should set_num_threads() also be mentioned in the README and set_num_threads(nothing) be tested (that it doesn't error, at least)? Or why is it included here?

mcabbott commented 4 years ago

I tried to minimally adapt the PR's tests, but I agree that it's odd that set_num_threads(::Nothing) isn't tested, I can add something. The difference from the existing function is that it accepts nothing, and that it prints more warnings. Seemed simpler to copy the whole new implementation than to split it.