Page MenuHomePhabricator

Add support for Intel's umonitor/umwait
ClosedPublic

Authored by tlwilmar on Tue, Nov 10, 10:27 AM.

Details

Summary

These changes add support for Intel's umonitor/umwait usage in wait code, for architectures that support those intrinsic functions. Usage of umonitor/umwait is off by default, but can be turned on by setting the KMP_USER_LEVEL_MWAIT environment variable.

Patch by Terry Wilmarth and Johnny Peyton.

Diff Detail

Event Timeline

tlwilmar created this revision.Tue, Nov 10, 10:27 AM
tlwilmar requested review of this revision.Tue, Nov 10, 10:27 AM
This revision is now accepted and ready to land.Wed, Nov 18, 1:43 PM
This revision was landed with ongoing or failed builds.Thu, Nov 19, 11:04 AM
This revision was automatically updated to reflect the committed changes.

This broke compilation for me:

../runtime/src/kmp.h:1371:3: error: always_inline function '_umonitor' requires target feature 'waitpkg', but would be inlined into function '__kmp_umonitor' that is compiled without support for 'waitpkg'
  _umonitor(cacheline);
  ^ 
../runtime/src/kmp.h:1390:10: error: always_inline function '_umwait' requires target feature 'waitpkg', but would be inlined into function '__kmp_umwait' that is compiled without support for 'waitpkg'
  return _umwait(hint, counter);
         ^
2 errors generated.

This broke compilation for me:

../runtime/src/kmp.h:1371:3: error: always_inline function '_umonitor' requires target feature 'waitpkg', but would be inlined into function '__kmp_umonitor' that is compiled without support for 'waitpkg'
  _umonitor(cacheline);
  ^ 
../runtime/src/kmp.h:1390:10: error: always_inline function '_umwait' requires target feature 'waitpkg', but would be inlined into function '__kmp_umwait' that is compiled without support for 'waitpkg'
  return _umwait(hint, counter);
         ^
2 errors generated.

I reverted the commit until we fix it.

This broke compilation for me:

Which compiler/version are you using?

This broke compilation for me:

Which compiler/version are you using?

Latest nightly clang, targeting mingw.

LGTM

https://llvm.org/docs/DeveloperPolicy.html#commit-messages Please use git commit --amend --author= for future patches for proper attribution.

https://llvm.org/docs/DeveloperPolicy.html#commit-messages Please use git commit --amend --author= for future patches for proper attribution.

Will do. Thanks for the notice.

tlwilmar edited the summary of this revision. (Show Details)Mon, Nov 30, 9:32 PM
tlwilmar updated this revision to Diff 308534.Mon, Nov 30, 9:36 PM

Fixed build problems associated with target attribute for waitpkg.

tlwilmar reopened this revision.Mon, Nov 30, 9:37 PM

Build problems associated with target attribute for waitpkg should be fixed now. Please try the new diff.

This revision is now accepted and ready to land.Mon, Nov 30, 9:37 PM

Build problems associated with target attribute for waitpkg should be fixed now. Please try the new diff.

Thanks, now it does seem to build correctly in my configurations.

Sorry, I missed one thing.

openmp/runtime/src/kmp_lock.cpp
2779–2781

Change these three lines to just KMP_ATTRIBUTE_TARGET_RTM

tlwilmar updated this revision to Diff 308688.Tue, Dec 1, 9:33 AM

One missed change added.

tlwilmar requested review of this revision.Tue, Dec 1, 9:35 AM
tlwilmar marked an inline comment as done.
jlpeyton accepted this revision.Tue, Dec 1, 10:12 AM

LGTM now.

This revision is now accepted and ready to land.Tue, Dec 1, 10:12 AM
This revision was automatically updated to reflect the committed changes.