[Openmp-commits] [PATCH] D157605: [OpenMP][OMPT] Fix `target enter data` callback ordering & reported device num
Dhruva Chakrabarti via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Aug 15 17:42:59 PDT 2023
dhruvachak added inline comments.
================
Comment at: openmp/libomptarget/src/interface.cpp:141
+ /// RAII to establish tool anchors before and after data begin / end / update
+ OMPT_IF_BUILT(auto *TargetDataRAII =
----------------
Can't you have the RAII here? That way, you don't need the new/delete.
You can add an assert that the type is one of the expected 3.
InterfaceRAII(
TargetDataFunction == targetDataBegin ?
RegionInterface.getCallbacks<ompt_target_enter_data>() :
TargetDataFunction == targetDataEnd ?
RegionInterface.getCallbacks<ompt_target_exit_data>() :
RegionInterface.getCallbacks<ompt_target_update>(),
DeviceId,
OMPT_GET_RETURN_ADDRESS(0));
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157605/new/
https://reviews.llvm.org/D157605
More information about the Openmp-commits
mailing list