Skip to content
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

Use the properly-capitalized C-ABI MKL threading interface #32

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

staticfloat
Copy link
Member

It appears that the all-lowercase threading symbols are actually all
FORTRAN ABI, as can be seen through dlsym():

julia> dlsym(libmkl_rt, "mkl_set_num_threads")
Ptr{Nothing} @0x00007fa64f24e3b0

julia> dlsym(libmkl_rt, "mkl_set_num_threads_")
Ptr{Nothing} @0x00007fa64f24e3b0

The C-ABI versions are not the non-underscore-suffixed ones, but the
capitalized ones, e.g. MKL_Set_Num_Threads. The more you know.

It appears that the all-lowercase threading symbols are actually all
FORTRAN ABI, as can be seen through `dlsym()`:

```
julia> dlsym(libmkl_rt, "mkl_set_num_threads")
Ptr{Nothing} @0x00007fa64f24e3b0

julia> dlsym(libmkl_rt, "mkl_set_num_threads_")
Ptr{Nothing} @0x00007fa64f24e3b0
```

The C-ABI versions are not the non-underscore-suffixed ones, but the
capitalized ones, e.g. `MKL_Set_Num_Threads`.  The more you know.
@staticfloat
Copy link
Member Author

Should fix JuliaLinearAlgebra/MKL.jl#67

@giordano
Copy link
Collaborator

giordano commented Mar 1, 2021

Is it worth adding a test here?

@ViralBShah
Copy link
Collaborator

Not really...

@staticfloat
Copy link
Member Author

The issue is that the only way to test it is to segfault. :(

@ViralBShah
Copy link
Collaborator

Can leave a comment in the code.

@giordano
Copy link
Collaborator

giordano commented Mar 1, 2021

The issue is that the only way to test it is to segfault. :(

I thought that was easy to achieve with this library 😛

@staticfloat staticfloat merged commit 5882fdf into main Mar 2, 2021
@staticfloat staticfloat deleted the sf/mkl_threading_capitalization branch March 2, 2021 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants