Page MenuHomePhabricator

[OpenMP] Add support for auxiliary triple specification

Authored by gtbercea on Jan 31 2017, 10:49 AM.



Device offloading requires the specification of an additional flag containing the triple of the other architecture the code is being compiled on if such an architecture exists. If compiling for the host, the auxiliary triple flag will contain the triple describing the device and vice versa.

Event Timeline

gtbercea created this revision.Jan 31 2017, 10:49 AM
gtbercea added a reviewer: arpith-jacob.
ABataev added inline comments.Feb 1 2017, 1:08 AM

It's better to check !getFrontendOpts().AuxTriple.empty() only once in this condition

gtbercea updated this revision to Diff 86635.Feb 1 2017, 7:31 AM

Condition changed to only check triple once.

gtbercea marked an inline comment as done.Feb 1 2017, 7:31 AM
gtbercea updated this revision to Diff 93171.Mar 27 2017, 1:10 PM

Update patch to reflect latest source code changes.

Hahnfeld accepted this revision.Mar 31 2017, 1:37 AM



I might be wrong here... Can you run the code through clang-format before committing to be sure?


Another micro optimization: (getLangOpts().CUDA || getLangOpts().OpenMPIsDevice) is probably cheaper than !getFrontendOpts().AuxTriple.empty() so it might be worth swapping the conditions as in the original code.

This revision is now accepted and ready to land.Mar 31 2017, 1:37 AM
gtbercea updated this revision to Diff 93643.Mar 31 2017, 7:57 AM

Re-order conditions and run clang-format.

gtbercea marked 2 inline comments as done.Mar 31 2017, 7:58 AM
gtbercea closed this revision.Jun 29 2017, 8:49 AM