This new API, int kmp_set_thread_affinity_mask_initial(), is available for use by other parallel runtime libraries inside a possibly OpenMP-registered thread. This entry point restores the current thread's affinity mask to the affinity mask of the application when it first began. If -1 is returned it can be assumed that either the thread hasn't called affinity initialization or that the thread isn't registered with the OpenMP library. If 0 is returned then, then the call was successful. Any return value greater than zero indicates an error occurred when setting affinity.
Details
Details
- Reviewers
tlwilmar AndreyChurbanov hfinkel - Commits
- rG3076fa4c35fc: New API for restoring current thread's affinity to init affinity of application
rOMP257489: New API for restoring current thread's affinity to init affinity of application
rL257489: New API for restoring current thread's affinity to init affinity of application
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM
May also worth adding comment in the code:
Note: supposed usage model is: (1) remember current affinity mask of the thread, (2) set initial mask by calling this routine, (3) use non-OpenMP parallelization, (4) restore affinity mask of the thread before returning to OpenMP parallelization.