diff --git a/openmp/libomptarget/include/omptarget.h b/openmp/libomptarget/include/omptarget.h --- a/openmp/libomptarget/include/omptarget.h +++ b/openmp/libomptarget/include/omptarget.h @@ -155,6 +155,8 @@ __tgt_device_image *DeviceImages; // Array of device images (1 per dev. type) __tgt_offload_entry *HostEntriesBegin; // Begin of table with all host entries __tgt_offload_entry *HostEntriesEnd; // End of table (non inclusive) + int64_t *RegisterRequiresBegin; // Begin of requires flag array. + int64_t *RegisterRequiresEnd; // End of requires flag array. }; /// This struct contains the offload entries identified by the target runtime diff --git a/openmp/libomptarget/src/LegacyAPI.cpp b/openmp/libomptarget/src/LegacyAPI.cpp --- a/openmp/libomptarget/src/LegacyAPI.cpp +++ b/openmp/libomptarget/src/LegacyAPI.cpp @@ -172,3 +172,7 @@ uint64_t LoopTripcount) { __kmpc_push_target_tripcount_mapper(nullptr, DeviceId, LoopTripcount); } + +EXTERN void __tgt_register_requires(int64_t Flags) { + DP("__tgt_register_requires has been deprecated"); +} diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -21,13 +21,6 @@ #include #include -//////////////////////////////////////////////////////////////////////////////// -/// adds requires flags -EXTERN void __tgt_register_requires(int64_t Flags) { - TIMESCOPE(); - PM->RTLs.registerRequires(Flags); -} - //////////////////////////////////////////////////////////////////////////////// /// adds a target shared library to the target execution image EXTERN void __tgt_register_lib(__tgt_bin_desc *Desc) { diff --git a/openmp/libomptarget/src/rtl.cpp b/openmp/libomptarget/src/rtl.cpp --- a/openmp/libomptarget/src/rtl.cpp +++ b/openmp/libomptarget/src/rtl.cpp @@ -423,6 +423,13 @@ void RTLsTy::registerLib(__tgt_bin_desc *Desc) { PM->RTLsMtx.lock(); + for (int64_t *RequiresB = Desc->RegisterRequiresBegin, + *RequiresE = Desc->RegisterRequiresEnd; + RequiresB != RequiresE; ++RequiresB) { + if (*RequiresB != OMP_REQ_UNDEFINED) + registerRequires(*RequiresB); + } + // Extract the exectuable image and extra information if availible. for (int32_t i = 0; i < Desc->NumDeviceImages; ++i) PM->Images.emplace_back(getExecutableImage(&Desc->DeviceImages[i]),