This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Implement the creation and registration of the offloading descriptor.
AbandonedPublic

Authored by sfantao on Aug 24 2015, 6:00 PM.

Details

Summary

All the offloading information is bundled into a descriptor that is passed to the runtime library so that it can extract all the binaries and map variables properly. This descriptor includes the range of the target binaries (that will be defined by the linker) for each device selected by the user, as well as table with the information about each function and variable that is to be mapped (given that we do not support 'declare target' directives yet this is only implemented for function, but the logic can/will be reused).

This patch adds support for the creation of the descriptor as well as the registration/unregistration of the descriptor with the runtime library. The registration is implemented in a high priority global initializer so that the registration happens always before any initializer (that can potentially include target regions) is run.

The frontend flag (it, or something similar, will have to be promoted to driver option in the future) -omptargets= was created to exercise the new functionality. It takes the list of triples of the devices the user wants to offload to.

This patch depends on http://reviews.llvm.org/D11361

Diff Detail

Event Timeline

sfantao updated this revision to Diff 33031.Aug 24 2015, 6:00 PM
sfantao retitled this revision from to [OpenMP] Implement the creation and registration of the offloading descriptor..
sfantao updated this object.
sfantao added reviewers: ABataev, rjmccall, hfinkel.
sfantao added a subscriber: cfe-commits.
sfantao updated this object.Aug 24 2015, 6:03 PM
sfantao abandoned this revision.Sep 3 2015, 4:22 PM

I am closing this revision as I added the functionality for the device codegen on top of this patch in http://reviews.llvm.org/D12614 because the two are tightly coupled.

Thanks,
Samuel

Herald added a project: Restricted Project. · View Herald Transcript