-
Notifications
You must be signed in to change notification settings - Fork 110
Bugfix/smith84/1754 openmp #1947
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
Conversation
…abled vs downstream applications. Remove error if downstream application is build without OpenMP when RAJA is built with OpenMP
|
@smithsg84 please note that LC GitLab CI checks will not run on a PR that is in draft stage; therefore, the PR cannot be merged. If you want this to go through all CI checks, please click the "Ready for review" button. |
|
Do we know why omp::mutex was used instead of std::mutex to begin with? Was the omp version more performant? |
|
I do not know. That code was developed at a time when the dpc++ compiler was being shaken out in terms of SYCL support. Maybe that was related to the choice. |
|
@smithsg84 I fixed the code formatting issues and restarted the CI checks on this. Everything is green. Is it good to merge? |
|
Folks, while this PR doesn't address all the issues, it is an improvement. We will make an issue for future work to be done. It is ready to merge. Please review. |
Fix for compilation failure when downstream library/application is built without OpenMP (SYCL) when RAJA was installed with OpenMP (SYCL).
This was tested by compiling example RAJA applications from the RAJA/examples directory against RAJA installed with different options. Also tested compiling RAJAPerSuite without OMP (SYCL) against RAJA built with OMP (SYCL).
For discussion:
Steve is very concerned this simple fix does not fully address the all the issues. There is a violation of C++ ODR principle by having compilation of the same functions / structures be controlled by each RAJA library. If two libraries are built, say the "with-OMP" library and the "without-OMP" library and then linked together into a single RAJA app the functions / data structures with the #if defined(RAJA_OPENMP_ACTIVE) preprocessor logic will be different.
Example for problematic conditional logic:
https://github.com/LLNL/RAJA/blob/85e009758125c97717f1d637a90520839280b8a5/include/RAJA/policy/cuda/MemUtils_CUDA.hpp#L209
Possible fix would be to template on the presences/absence of OpenMP to disambiguate rather then preprocessor. Steve not sure ramifications of doing a template fix.