This is an archive of the discontinued LLVM Phabricator instance.

Read OMP_TARGET_OFFLOAD and provide API to access ICV
ClosedPublic

Authored by tlwilmar on Mar 16 2018, 12:49 PM.

Details

Summary

Added settings code to read OMP_TARGET_OFFLOAD environment variable. Added target-offload-var ICV as kmp_target_offload, set via OMP_TARGET_OFFLOAD, if available, otherwise defaulting to DEFAULT. Valid values for the ICV are specified as enum values {0,1,2} for disabled, default, and mandatory. An internal API access function kmpc_get_target_offload is provided.

Diff Detail

Repository
rL LLVM

Event Timeline

tlwilmar created this revision.Mar 16 2018, 12:49 PM
tlwilmar added inline comments.Mar 16 2018, 12:52 PM
runtime/src/dllexports
406 ↗(On Diff #138747)

I know this looks a bit funny, but we have another patch on the way to clean this up and put this properly under 5.0. %ifdef.

Question: If the ICV is set to DEFAULT, then libomptarget must change it to either MANDATORY (if there are available devices in the system) or DISABLED (if there are no devices). Should libomptarget notify libomp about this change?

DEFAULT implies MANDATORY or DISABLED. Don't need to communicate to libomp

This revision is now accepted and ready to land.Mar 19 2018, 5:35 AM
This revision was automatically updated to reflect the committed changes.