[OpenMP] [OMPT] [3/8] Implemented callback registration in libomptarget
authorDhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>
Thu, 8 Dec 2022 18:57:11 +0000 (10:57 -0800)
committerDhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>
Thu, 8 Dec 2022 19:43:10 +0000 (11:43 -0800)
commitaa4c0f116c93a91186291ca3255583fc5deae7f1
tree1dcd63f6f8c755af56e37ae06d73ec2356bc194b
parent47b988403d15233eb405b9f7db7d6c6c428bb5dc
[OpenMP] [OMPT] [3/8] Implemented callback registration in libomptarget

The purpose of this patch is to have tool-provided callbacks registered
in libomptarget. The overall design document is in
https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

Defined a class OmptDeviceCallbacksTy that will be used by libomptarget
and a plugin for callbacks registered by a tool. Once the callbacks are
registered in libomp, a lookup function is passed to libomptarget that is
used to retrieve the callbacks and register them in libomptarget.

Patch from John Mellor-Crummey <johnmc@rice.edu>
(With contributions from Dhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>)

Reviewed By: jplehr, tianshilei1992

Differential Revision: https://reviews.llvm.org/D123974
openmp/libomptarget/include/ompt_connector.h
openmp/libomptarget/include/ompt_device_callbacks.h [new file with mode: 0644]
openmp/libomptarget/src/ompt_callback.cpp