-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting MKL thread number #174
Comments
Hi @hakkelt, in terms of oneMKL logic |
Hi @mkrainiuk, thanks for the clarification; it helped a lot! However, the problem I faced in my project remains: In my current project, I managed to solve the problem by calling C-API directly and setting the thread count for all domains: mkl_get_num_threads() = ccall((:mkl_get_max_threads, libmkl_rt), Int32, ())
mkl_set_num_threads(n) = ccall((:mkl_set_num_threads, libmkl_rt), Cvoid, (Ptr{Int32},), Ref(Int32(n))) Wouldn't it make sense to expose these functions in MKL.jl and add some explanation to readme? Or is there a more straightforward solution? |
I'm not sure if I understood the docs correctly, but I assumed that
BLAS.set_num_threads(n)
==mkl_set_num_threads(n)
andBLAS.get_num_threads()
==mkl_get_max_threads()
. It seems, however, that it might not be the case. At least, if I'm callingmkl_set_num_threads
first,BLAS.get_num_threads
shows the correct value, but callingBLAS.set_num_threads
does not affect the result ofmkl_get_max_threads
. Moreover, if I'm callingBLAS.set_num_threads
first, then subsequent calls tomkl_set_num_threads
would not change the value returned byBLAS.get_num_threads
... I also triedMKL_DYNAMIC=TRUE
, but there was no difference. Can someone clarify what's going on?The text was updated successfully, but these errors were encountered: