From cf119df548030eee0059d317d691dcbd2160b0d7 Mon Sep 17 00:00:00 2001 From: Michael Halkenhaeuser Date: Tue, 25 Jul 2023 06:21:51 -0400 Subject: Revert "[OpenMP] [OMPT] [7/8] Invoke tool-supplied callbacks before and after target launch and data transfer operations" This reverts commit 00ccfcf9a6ee61c56cbe01d1e01b074797465fa4. --- openmp/libomptarget/include/OmptCallback.h | 9 -- openmp/libomptarget/src/OmptCallback.cpp | 99 +++++++++--------- openmp/libomptarget/src/OmptInterface.h | 111 +-------------------- openmp/libomptarget/src/device.cpp | 28 ------ openmp/libomptarget/src/interface.cpp | 25 ----- openmp/libomptarget/src/omptarget.cpp | 13 --- openmp/libomptarget/test/ompt/veccopy.c | 27 +---- .../libomptarget/test/ompt/veccopy_disallow_both.c | 42 +------- openmp/libomptarget/test/ompt/veccopy_emi.c | 44 +------- openmp/libomptarget/test/ompt/veccopy_emi_map.c | 46 +-------- openmp/libomptarget/test/ompt/veccopy_map.c | 27 +---- .../test/ompt/veccopy_no_device_init.c | 27 +---- .../libomptarget/test/ompt/veccopy_wrong_return.c | 29 +----- openmp/runtime/src/ompt-event-specific.h | 13 +-- 14 files changed, 83 insertions(+), 457 deletions(-) diff --git a/openmp/libomptarget/include/OmptCallback.h b/openmp/libomptarget/include/OmptCallback.h index 79d6bf8..885029f 100644 --- a/openmp/libomptarget/include/OmptCallback.h +++ b/openmp/libomptarget/include/OmptCallback.h @@ -27,13 +27,6 @@ FOREACH_OMPT_NOEMI_EVENT(macro) \ FOREACH_OMPT_EMI_EVENT(macro) -#define performIfOmptInitialized(stmt) \ - do { \ - if (llvm::omp::target::ompt::Initialized) { \ - stmt; \ - } \ - } while (0) - #define performOmptCallback(CallbackName, ...) \ do { \ if (ompt_callback_##CallbackName##_fn) \ @@ -96,8 +89,6 @@ extern bool Initialized; } // namespace omp } // namespace llvm -#else -#define performIfOmptInitialized(stmt) #endif // OMPT_SUPPORT #pragma pop_macro("DEBUG_PREFIX") diff --git a/openmp/libomptarget/src/OmptCallback.cpp b/openmp/libomptarget/src/OmptCallback.cpp index cd44d09..2d9959e0 100644 --- a/openmp/libomptarget/src/OmptCallback.cpp +++ b/openmp/libomptarget/src/OmptCallback.cpp @@ -35,20 +35,12 @@ FOREACH_OMPT_NOEMI_EVENT(defineOmptCallback) FOREACH_OMPT_EMI_EVENT(defineOmptCallback) #undef defineOmptCallback -/// Forward declaration -class LibomptargetRtlFinalizer; +/// Thread local state for target region and associated metadata +thread_local llvm::omp::target::ompt::Interface OmptInterface; -/// Object that will maintain the RTL finalizer from the plugin -LibomptargetRtlFinalizer *LibraryFinalizer = nullptr; - -thread_local Interface llvm::omp::target::ompt::RegionInterface; - -bool llvm::omp::target::ompt::Initialized = false; - -ompt_get_callback_t llvm::omp::target::ompt::lookupCallbackByCode = nullptr; -ompt_function_lookup_t llvm::omp::target::ompt::lookupCallbackByName = nullptr; -ompt_get_target_task_data_t ompt_get_target_task_data_fn = nullptr; +/// Define function pointers ompt_get_task_data_t ompt_get_task_data_fn = nullptr; +ompt_get_target_task_data_t ompt_get_target_task_data_fn = nullptr; /// Unique correlation id static std::atomic IdCounter(1); @@ -59,14 +51,14 @@ static uint64_t createId() { return IdCounter.fetch_add(1); } /// Create a new correlation id and update the operations id static uint64_t createOpId() { uint64_t NewId = createId(); - RegionInterface.setHostOpId(NewId); + OmptInterface.setHostOpId(NewId); return NewId; } /// Create a new correlation id and update the target region id static uint64_t createRegionId() { uint64_t NewId = createId(); - RegionInterface.setTargetDataValue(NewId); + OmptInterface.setTargetDataValue(NewId); return NewId; } @@ -76,19 +68,18 @@ void Interface::beginTargetDataAlloc(int64_t DeviceId, void *HstPtrBegin, if (ompt_callback_target_data_op_emi_fn) { // HostOpId will be set by the tool. Invoke the tool supplied data op EMI // callback - ompt_callback_target_data_op_emi_fn( - ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId, - ompt_target_data_alloc, HstPtrBegin, - /* SrcDeviceNum */ omp_get_initial_device(), /* TgtPtrBegin */ nullptr, - /* TgtDeviceNum */ DeviceId, Size, Code); + ompt_callback_target_data_op_emi_fn(ompt_scope_begin, TargetTaskData, + &TargetData, &TargetRegionOpId, + ompt_target_data_alloc, HstPtrBegin, + DeviceId, /* TgtPtrBegin */ nullptr, + /* TgtDeviceNum */ 0, Size, Code); } else if (ompt_callback_target_data_op_fn) { // HostOpId is set by the runtime HostOpId = createOpId(); // Invoke the tool supplied data op callback ompt_callback_target_data_op_fn( TargetData.value, HostOpId, ompt_target_data_alloc, HstPtrBegin, - /* SrcDeviceNum */ omp_get_initial_device(), /* TgtPtrBegin */ nullptr, - /* TgtDeviceNum */ DeviceId, Size, Code); + DeviceId, /* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ 0, Size, Code); } } @@ -98,11 +89,11 @@ void Interface::endTargetDataAlloc(int64_t DeviceId, void *HstPtrBegin, if (ompt_callback_target_data_op_emi_fn) { // HostOpId will be set by the tool. Invoke the tool supplied data op EMI // callback - ompt_callback_target_data_op_emi_fn( - ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId, - ompt_target_data_alloc, HstPtrBegin, - /* SrcDeviceNum */ omp_get_initial_device(), /* TgtPtrBegin */ nullptr, - /* TgtDeviceNum */ DeviceId, Size, Code); + ompt_callback_target_data_op_emi_fn(ompt_scope_end, TargetTaskData, + &TargetData, &TargetRegionOpId, + ompt_target_data_alloc, HstPtrBegin, + DeviceId, /* TgtPtrBegin */ nullptr, + /* TgtDeviceNum */ 0, Size, Code); } endTargetDataOperation(); } @@ -117,16 +108,14 @@ void Interface::beginTargetDataSubmit(int64_t DeviceId, void *TgtPtrBegin, ompt_callback_target_data_op_emi_fn( ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId, ompt_target_data_transfer_to_device, HstPtrBegin, - /* SrcDeviceNum */ omp_get_initial_device(), TgtPtrBegin, DeviceId, - Size, Code); + /* SrcDeviceNum */ 0, TgtPtrBegin, DeviceId, Size, Code); } else if (ompt_callback_target_data_op_fn) { // HostOpId is set by the runtime HostOpId = createOpId(); // Invoke the tool supplied data op callback ompt_callback_target_data_op_fn( TargetData.value, HostOpId, ompt_target_data_transfer_to_device, - HstPtrBegin, /* SrcDeviceNum */ omp_get_initial_device(), TgtPtrBegin, - DeviceId, Size, Code); + HstPtrBegin, /* SrcDeviceNum */ 0, TgtPtrBegin, DeviceId, Size, Code); } } @@ -140,8 +129,7 @@ void Interface::endTargetDataSubmit(int64_t DeviceId, void *TgtPtrBegin, ompt_callback_target_data_op_emi_fn( ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId, ompt_target_data_transfer_to_device, HstPtrBegin, - /* SrcDeviceNum */ omp_get_initial_device(), TgtPtrBegin, DeviceId, - Size, Code); + /* SrcDeviceNum */ 0, TgtPtrBegin, DeviceId, Size, Code); } endTargetDataOperation(); } @@ -155,7 +143,7 @@ void Interface::beginTargetDataDelete(int64_t DeviceId, void *TgtPtrBegin, ompt_callback_target_data_op_emi_fn( ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId, ompt_target_data_delete, TgtPtrBegin, DeviceId, - /* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ -1, /* Bytes */ 0, Code); + /* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ 0, /* Bytes */ 0, Code); } else if (ompt_callback_target_data_op_fn) { // HostOpId is set by the runtime HostOpId = createOpId(); @@ -163,7 +151,7 @@ void Interface::beginTargetDataDelete(int64_t DeviceId, void *TgtPtrBegin, ompt_callback_target_data_op_fn(TargetData.value, HostOpId, ompt_target_data_delete, TgtPtrBegin, DeviceId, /* TgtPtrBegin */ nullptr, - /* TgtDeviceNum */ -1, /* Bytes */ 0, Code); + /* TgtDeviceNum */ 0, /* Bytes */ 0, Code); } } @@ -176,7 +164,7 @@ void Interface::endTargetDataDelete(int64_t DeviceId, void *TgtPtrBegin, ompt_callback_target_data_op_emi_fn( ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId, ompt_target_data_delete, TgtPtrBegin, DeviceId, - /* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ -1, /* Bytes */ 0, Code); + /* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ 0, /* Bytes */ 0, Code); } endTargetDataOperation(); } @@ -188,19 +176,19 @@ void Interface::beginTargetDataRetrieve(int64_t DeviceId, void *HstPtrBegin, if (ompt_callback_target_data_op_emi_fn) { // HostOpId will be set by the tool. Invoke the tool supplied data op EMI // callback - ompt_callback_target_data_op_emi_fn( - ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId, - ompt_target_data_transfer_from_device, TgtPtrBegin, DeviceId, - HstPtrBegin, - /* TgtDeviceNum */ omp_get_initial_device(), Size, Code); + ompt_callback_target_data_op_emi_fn(ompt_scope_begin, TargetTaskData, + &TargetData, &TargetRegionOpId, + ompt_target_data_transfer_from_device, + TgtPtrBegin, DeviceId, HstPtrBegin, + /* TgtDeviceNum */ 0, Size, Code); } else if (ompt_callback_target_data_op_fn) { // HostOpId is set by the runtime HostOpId = createOpId(); // Invoke the tool supplied data op callback - ompt_callback_target_data_op_fn( - TargetData.value, HostOpId, ompt_target_data_transfer_from_device, - TgtPtrBegin, DeviceId, HstPtrBegin, - /* TgtDeviceNum */ omp_get_initial_device(), Size, Code); + ompt_callback_target_data_op_fn(TargetData.value, HostOpId, + ompt_target_data_transfer_from_device, + TgtPtrBegin, DeviceId, HstPtrBegin, + /* TgtDeviceNum */ 0, Size, Code); } } @@ -211,11 +199,11 @@ void Interface::endTargetDataRetrieve(int64_t DeviceId, void *HstPtrBegin, if (ompt_callback_target_data_op_emi_fn) { // HostOpId will be set by the tool. Invoke the tool supplied data op EMI // callback - ompt_callback_target_data_op_emi_fn( - ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId, - ompt_target_data_transfer_from_device, TgtPtrBegin, DeviceId, - HstPtrBegin, - /* TgtDeviceNum */ omp_get_initial_device(), Size, Code); + ompt_callback_target_data_op_emi_fn(ompt_scope_end, TargetTaskData, + &TargetData, &TargetRegionOpId, + ompt_target_data_transfer_from_device, + TgtPtrBegin, DeviceId, HstPtrBegin, + /* TgtDeviceNum */ 0, Size, Code); } endTargetDataOperation(); } @@ -242,7 +230,6 @@ void Interface::endTargetSubmit(unsigned int numTeams) { numTeams); } } - void Interface::beginTargetDataEnter(int64_t DeviceId, void *Code) { beginTargetRegion(); if (ompt_callback_target_emi_fn) { @@ -404,6 +391,14 @@ private: llvm::SmallVector RtlFinalizationFunctions; }; +/// Object that will maintain the RTL finalizer from the plugin +LibomptargetRtlFinalizer *LibraryFinalizer = nullptr; + +bool llvm::omp::target::ompt::Initialized = false; + +ompt_get_callback_t llvm::omp::target::ompt::lookupCallbackByCode = nullptr; +ompt_function_lookup_t llvm::omp::target::ompt::lookupCallbackByName = nullptr; + int llvm::omp::target::ompt::initializeLibrary(ompt_function_lookup_t lookup, int initial_device_num, ompt_data_t *tool_data) { @@ -423,9 +418,6 @@ int llvm::omp::target::ompt::initializeLibrary(ompt_function_lookup_t lookup, assert(lookupCallbackByCode && "lookupCallbackByCode should be non-null"); assert(lookupCallbackByName && "lookupCallbackByName should be non-null"); - assert(ompt_get_task_data_fn && "ompt_get_task_data_fn should be non-null"); - assert(ompt_get_target_task_data_fn && - "ompt_get_target_task_data_fn should be non-null"); assert(LibraryFinalizer == nullptr && "LibraryFinalizer should not be initialized yet"); @@ -442,7 +434,6 @@ void llvm::omp::target::ompt::finalizeLibrary(ompt_data_t *data) { // with this library LibraryFinalizer->finalize(); delete LibraryFinalizer; - Initialized = false; } void llvm::omp::target::ompt::connectLibrary() { diff --git a/openmp/libomptarget/src/OmptInterface.h b/openmp/libomptarget/src/OmptInterface.h index 4aeae2c..e2553c1 100644 --- a/openmp/libomptarget/src/OmptInterface.h +++ b/openmp/libomptarget/src/OmptInterface.h @@ -13,14 +13,8 @@ #ifndef _OMPTARGET_OMPTINTERFACE_H #define _OMPTARGET_OMPTINTERFACE_H -#include -#include - -#include "OmptCallback.h" #include "omp-tools.h" -#include "llvm/Support/ErrorHandling.h" - // If target OMPT support is compiled in #ifdef OMPT_SUPPORT #define OMPT_IF_BUILT(stmt) stmt @@ -28,8 +22,6 @@ #define OMPT_IF_BUILT(stmt) #endif -#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level) - /// Callbacks for target regions require task_data representing the /// encountering task. /// Callbacks for target regions and target data ops require @@ -116,66 +108,6 @@ public: /// Top-level function for invoking callback after target construct void endTarget(int64_t DeviceId, void *Code); - // Callback getter: Target data operations - template auto getCallbacks() { - if constexpr (OpType == ompt_target_data_alloc || - OpType == ompt_target_data_alloc_async) - return std::make_pair(std::mem_fn(&Interface::beginTargetDataAlloc), - std::mem_fn(&Interface::endTargetDataAlloc)); - - if constexpr (OpType == ompt_target_data_delete || - OpType == ompt_target_data_delete_async) - return std::make_pair(std::mem_fn(&Interface::beginTargetDataDelete), - std::mem_fn(&Interface::endTargetDataDelete)); - - if constexpr (OpType == ompt_target_data_transfer_to_device || - OpType == ompt_target_data_transfer_to_device_async) - return std::make_pair(std::mem_fn(&Interface::beginTargetDataSubmit), - std::mem_fn(&Interface::endTargetDataSubmit)); - - if constexpr (OpType == ompt_target_data_transfer_from_device || - OpType == ompt_target_data_transfer_from_device_async) - return std::make_pair(std::mem_fn(&Interface::beginTargetDataRetrieve), - std::mem_fn(&Interface::endTargetDataRetrieve)); - - llvm_unreachable("Unhandled target data operation type!"); - } - - // Callback getter: Target region operations - template auto getCallbacks() { - if constexpr (OpType == ompt_target_enter_data || - OpType == ompt_target_enter_data_nowait) - return std::make_pair(std::mem_fn(&Interface::beginTargetDataEnter), - std::mem_fn(&Interface::endTargetDataEnter)); - - if constexpr (OpType == ompt_target_exit_data || - OpType == ompt_target_exit_data_nowait) - return std::make_pair(std::mem_fn(&Interface::beginTargetDataExit), - std::mem_fn(&Interface::endTargetDataExit)); - - if constexpr (OpType == ompt_target_update || - OpType == ompt_target_update_nowait) - return std::make_pair(std::mem_fn(&Interface::beginTargetUpdate), - std::mem_fn(&Interface::endTargetUpdate)); - - if constexpr (OpType == ompt_target || OpType == ompt_target_nowait) - return std::make_pair(std::mem_fn(&Interface::beginTarget), - std::mem_fn(&Interface::endTarget)); - - llvm_unreachable("Unknown target region operation type!"); - } - - // Callback getter: Kernel launch operation - template auto getCallbacks() { - // We use 'ompt_callbacks_t', because no other enum is currently available - // to model a kernel launch / target submit operation. - if constexpr (OpType == ompt_callback_target_submit) - return std::make_pair(std::mem_fn(&Interface::beginTargetSubmit), - std::mem_fn(&Interface::endTargetSubmit)); - - llvm_unreachable("Unhandled target operation!"); - } - /// Setters for target region and target operation correlation ids void setTargetDataValue(uint64_t DataValue) { TargetData.value = DataValue; } void setTargetDataPtr(void *DataPtr) { TargetData.ptr = DataPtr; } @@ -215,50 +147,11 @@ private: void endTargetRegion(); }; -/// Thread local state for target region and associated metadata -extern thread_local Interface RegionInterface; - -template -void InvokeInterfaceFunction(FuncTy Func, ArgsTy Args, - std::index_sequence) { - std::invoke(Func, RegionInterface, std::get(Args)...); -} - -template class InterfaceRAII { -public: - InterfaceRAII(CallbackPairTy Callbacks, ArgsTy... Args) - : Arguments(Args...), beginFunction(std::get<0>(Callbacks)), - endFunction(std::get<1>(Callbacks)) { - performIfOmptInitialized(begin()); - } - ~InterfaceRAII() { performIfOmptInitialized(end()); } - -private: - void begin() { - auto IndexSequence = - std::make_index_sequence>{}; - InvokeInterfaceFunction(beginFunction, Arguments, IndexSequence); - } - - void end() { - auto IndexSequence = - std::make_index_sequence>{}; - InvokeInterfaceFunction(endFunction, Arguments, IndexSequence); - } - - std::tuple Arguments; - typename CallbackPairTy::first_type beginFunction; - typename CallbackPairTy::second_type endFunction; -}; - -// InterfaceRAII's class template argument deduction guide -template -InterfaceRAII(CallbackPairTy Callbacks, ArgsTy... Args) - -> InterfaceRAII; - } // namespace ompt } // namespace target } // namespace omp } // namespace llvm +extern thread_local llvm::omp::target::ompt::Interface OmptInterface; + #endif // _OMPTARGET_OMPTINTERFACE_H diff --git a/openmp/libomptarget/src/device.cpp b/openmp/libomptarget/src/device.cpp index 2a40591..a5409e2 100644 --- a/openmp/libomptarget/src/device.cpp +++ b/openmp/libomptarget/src/device.cpp @@ -11,8 +11,6 @@ //===----------------------------------------------------------------------===// #include "device.h" -#include "OmptCallback.h" -#include "OmptInterface.h" #include "omptarget.h" #include "private.h" #include "rtl.h" @@ -25,8 +23,6 @@ #include #include -using namespace llvm::omp::target::ompt; - int HostDataToTargetTy::addEventIfNecessary(DeviceTy &Device, AsyncInfoTy &AsyncInfo) const { // First, check if the user disabled atomic map transfer/malloc/dealloc. @@ -558,22 +554,10 @@ __tgt_target_table *DeviceTy::loadBinary(void *Img) { } void *DeviceTy::allocData(int64_t Size, void *HstPtr, int32_t Kind) { - /// RAII to establish tool anchors before and after data allocation - InterfaceRAII TargetDataAllocRAII( - RegionInterface.getCallbacks(), RTLDeviceID, - HstPtr, Size, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - return RTL->data_alloc(RTLDeviceID, Size, HstPtr, Kind); } int32_t DeviceTy::deleteData(void *TgtAllocBegin, int32_t Kind) { - /// RAII to establish tool anchors before and after data deletion - InterfaceRAII TargetDataDeleteRAII( - RegionInterface.getCallbacks(), RTLDeviceID, - TgtAllocBegin, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - return RTL->data_delete(RTLDeviceID, TgtAllocBegin, Kind); } @@ -605,12 +589,6 @@ int32_t DeviceTy::submitData(void *TgtPtrBegin, void *HstPtrBegin, int64_t Size, Entry); } - /// RAII to establish tool anchors before and after data submit - InterfaceRAII TargetDataSubmitRAII( - RegionInterface.getCallbacks(), - RTLDeviceID, TgtPtrBegin, HstPtrBegin, Size, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - if (!AsyncInfo || !RTL->data_submit_async || !RTL->synchronize) return RTL->data_submit(RTLDeviceID, TgtPtrBegin, HstPtrBegin, Size); return RTL->data_submit_async(RTLDeviceID, TgtPtrBegin, HstPtrBegin, Size, @@ -632,12 +610,6 @@ int32_t DeviceTy::retrieveData(void *HstPtrBegin, void *TgtPtrBegin, Entry); } - /// RAII to establish tool anchors before and after data retrieval - InterfaceRAII TargetDataRetrieveRAII( - RegionInterface.getCallbacks(), - RTLDeviceID, HstPtrBegin, TgtPtrBegin, Size, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - if (!RTL->data_retrieve_async || !RTL->synchronize) return RTL->data_retrieve(RTLDeviceID, HstPtrBegin, TgtPtrBegin, Size); return RTL->data_retrieve_async(RTLDeviceID, HstPtrBegin, TgtPtrBegin, Size, diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp index e7467a2..6f9c63a 100644 --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -11,8 +11,6 @@ // //===----------------------------------------------------------------------===// -#include "OmptCallback.h" -#include "OmptInterface.h" #include "device.h" #include "omptarget.h" #include "private.h" @@ -26,8 +24,6 @@ #include #include -using namespace llvm::omp::target::ompt; - //////////////////////////////////////////////////////////////////////////////// /// adds requires flags EXTERN void __tgt_register_requires(int64_t Flags) { @@ -127,11 +123,6 @@ EXTERN void __tgt_target_data_begin_mapper(ident_t *Loc, int64_t DeviceId, map_var_info_t *ArgNames, void **ArgMappers) { TIMESCOPE_WITH_IDENT(Loc); - /// RAII to establish tool anchors before and after data begin - InterfaceRAII TargetDataEnterRAII( - RegionInterface.getCallbacks(), DeviceId, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - targetDataMapper(Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, targetDataBegin, "Entering OpenMP data region", "begin"); @@ -158,11 +149,6 @@ EXTERN void __tgt_target_data_end_mapper(ident_t *Loc, int64_t DeviceId, map_var_info_t *ArgNames, void **ArgMappers) { TIMESCOPE_WITH_IDENT(Loc); - /// RAII to establish tool anchors before and after data end - InterfaceRAII TargetDataExitRAII( - RegionInterface.getCallbacks(), DeviceId, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - targetDataMapper(Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, targetDataEnd, "Exiting OpenMP data region", "end"); @@ -186,11 +172,6 @@ EXTERN void __tgt_target_data_update_mapper(ident_t *Loc, int64_t DeviceId, map_var_info_t *ArgNames, void **ArgMappers) { TIMESCOPE_WITH_IDENT(Loc); - /// RAII to establish tool anchors before and after data update - InterfaceRAII TargetDataUpdateRAII( - RegionInterface.getCallbacks(), DeviceId, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); - targetDataMapper( Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, targetDataUpdate, "Updating OpenMP data", "update"); @@ -290,9 +271,6 @@ static inline int targetKernel(ident_t *Loc, int64_t DeviceId, int32_t NumTeams, DeviceTy &Device = *PM->Devices[DeviceId]; TargetAsyncInfoTy TargetAsyncInfo(Device); AsyncInfoTy &AsyncInfo = TargetAsyncInfo; - InterfaceRAII TargetDataAllocRAII(RegionInterface.getCallbacks(), - DeviceId, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); int Rc = OFFLOAD_SUCCESS; Rc = target(Loc, Device, HostPtr, *KernelArgs, AsyncInfo); @@ -358,9 +336,6 @@ EXTERN int __tgt_target_kernel_replay(ident_t *Loc, int64_t DeviceId, return OMP_TGT_FAIL; } DeviceTy &Device = *PM->Devices[DeviceId]; - InterfaceRAII TargetDataAllocRAII(RegionInterface.getCallbacks(), - DeviceId, - /* CodePtr */ OMPT_GET_RETURN_ADDRESS(0)); AsyncInfoTy AsyncInfo(Device); int Rc = target_replay(Loc, Device, HostPtr, DeviceMemory, DeviceMemorySize, diff --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp index 61b6576..45576c6 100644 --- a/openmp/libomptarget/src/omptarget.cpp +++ b/openmp/libomptarget/src/omptarget.cpp @@ -12,8 +12,6 @@ //===----------------------------------------------------------------------===// #include "omptarget.h" -#include "OmptCallback.h" -#include "OmptInterface.h" #include "device.h" #include "private.h" #include "rtl.h" @@ -26,7 +24,6 @@ #include using llvm::SmallVector; -using namespace llvm::omp::target::ompt; int AsyncInfoTy::synchronize() { int Result = OFFLOAD_SUCCESS; @@ -1673,16 +1670,6 @@ int target(ident_t *Loc, DeviceTy &Device, void *HostPtr, { assert(KernelArgs.NumArgs == TgtArgs.size() && "Argument count mismatch!"); TIMESCOPE_WITH_NAME_AND_IDENT("Initiate Kernel Launch", Loc); - -#ifdef OMPT_SUPPORT - assert(KernelArgs.NumTeams[1] == 0 && KernelArgs.NumTeams[2] == 0 && - "Multi dimensional launch not supported yet."); - /// RAII to establish tool anchors before and after kernel launch - int32_t NumTeams = KernelArgs.NumTeams[0]; - InterfaceRAII TargetSubmitRAII( - RegionInterface.getCallbacks(), NumTeams); -#endif - Ret = Device.launchKernel(TgtEntryPtr, TgtArgs.data(), TgtOffsets.data(), KernelArgs, AsyncInfo); } diff --git a/openmp/libomptarget/test/ompt/veccopy.c b/openmp/libomptarget/test/ompt/veccopy.c index eb14f10..2293e46 100644 --- a/openmp/libomptarget/test/ompt/veccopy.c +++ b/openmp/libomptarget/test/ompt/veccopy.c @@ -55,29 +55,10 @@ int main() { return rc; } +/// CHECK: Could not register callback 'ompt_callback_target_data_op' +/// CHECK: Could not register callback 'ompt_callback_target' +/// CHECK: Could not register callback 'ompt_callback_target_submit' + /// CHECK: Callback Init: /// CHECK: Callback Load: -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 - -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 /// CHECK: Callback Fini: diff --git a/openmp/libomptarget/test/ompt/veccopy_disallow_both.c b/openmp/libomptarget/test/ompt/veccopy_disallow_both.c index 6fdcfdb..ba16cda 100644 --- a/openmp/libomptarget/test/ompt/veccopy_disallow_both.c +++ b/openmp/libomptarget/test/ompt/veccopy_disallow_both.c @@ -58,44 +58,10 @@ int main() { return rc; } +/// CHECK: Could not register callback 'ompt_callback_target_data_op' +/// CHECK: Could not register callback 'ompt_callback_target' +/// CHECK: Could not register callback 'ompt_callback_target_submit' + /// CHECK: Callback Init: /// CHECK: Callback Load: -/// CHECK: Callback Target EMI: kind=1 endpoint=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback Target EMI: kind=1 endpoint=2 -/// CHECK: Callback Target EMI: kind=1 endpoint=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback Target EMI: kind=1 endpoint=2 /// CHECK: Callback Fini: diff --git a/openmp/libomptarget/test/ompt/veccopy_emi.c b/openmp/libomptarget/test/ompt/veccopy_emi.c index f15dfb1..6f22ed2 100644 --- a/openmp/libomptarget/test/ompt/veccopy_emi.c +++ b/openmp/libomptarget/test/ompt/veccopy_emi.c @@ -56,46 +56,10 @@ int main() { return rc; } +/// CHECK: Could not register callback 'ompt_callback_target_data_op_emi' +/// CHECK: Could not register callback 'ompt_callback_target_emi' +/// CHECK: Could not register callback 'ompt_callback_target_submit_emi' + /// CHECK: Callback Init: /// CHECK: Callback Load: -/// CHECK: Callback Target EMI: kind=1 endpoint=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=1 -/// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback Target EMI: kind=1 endpoint=2 -/// CHECK: Callback Target EMI: kind=1 endpoint=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=0 -/// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=0 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback Target EMI: kind=1 endpoint=2 /// CHECK: Callback Fini: diff --git a/openmp/libomptarget/test/ompt/veccopy_emi_map.c b/openmp/libomptarget/test/ompt/veccopy_emi_map.c index af0743f..25e0b78 100644 --- a/openmp/libomptarget/test/ompt/veccopy_emi_map.c +++ b/openmp/libomptarget/test/ompt/veccopy_emi_map.c @@ -56,47 +56,11 @@ int main() { return rc; } -/// CHECK: 0: Could not register callback 'ompt_callback_target_map_emi' +/// CHECK: Could not register callback 'ompt_callback_target_data_op_emi' +/// CHECK: Could not register callback 'ompt_callback_target_emi' +/// CHECK: Could not register callback 'ompt_callback_target_submit_emi' +/// CHECK: Could not register callback 'ompt_callback_target_map_emi' + /// CHECK: Callback Init: /// CHECK: Callback Load: -/// CHECK: Callback Target EMI: kind=1 endpoint=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=1 -/// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback Target EMI: kind=1 endpoint=2 -/// CHECK: Callback Target EMI: kind=1 endpoint=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=1 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=2 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=2 -/// CHECK: Callback Submit EMI: endpoint=1 req_num_teams=0 -/// CHECK: Callback Submit EMI: endpoint=2 req_num_teams=0 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=3 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=1 optype=4 -/// CHECK: Callback DataOp EMI: endpoint=2 optype=4 -/// CHECK: Callback Target EMI: kind=1 endpoint=2 /// CHECK: Callback Fini: diff --git a/openmp/libomptarget/test/ompt/veccopy_map.c b/openmp/libomptarget/test/ompt/veccopy_map.c index 6b3f408..9929e50 100644 --- a/openmp/libomptarget/test/ompt/veccopy_map.c +++ b/openmp/libomptarget/test/ompt/veccopy_map.c @@ -55,31 +55,10 @@ int main() { return rc; } +/// CHECK: Could not register callback 'ompt_callback_target_data_op' +/// CHECK: Could not register callback 'ompt_callback_target' +/// CHECK: Could not register callback 'ompt_callback_target_submit' -/// CHECK: 0: Could not register callback 'ompt_callback_target_map' /// CHECK: Callback Init: /// CHECK: Callback Load: -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 - -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 /// CHECK: Callback Fini: diff --git a/openmp/libomptarget/test/ompt/veccopy_no_device_init.c b/openmp/libomptarget/test/ompt/veccopy_no_device_init.c index 0b4f012..0bb9c46 100644 --- a/openmp/libomptarget/test/ompt/veccopy_no_device_init.c +++ b/openmp/libomptarget/test/ompt/veccopy_no_device_init.c @@ -54,29 +54,10 @@ int main() { return rc; } +/// CHECK: Could not register callback 'ompt_callback_target_data_op' +/// CHECK: Could not register callback 'ompt_callback_target' +/// CHECK: Could not register callback 'ompt_callback_target_submit' + /// CHECK-NOT: Callback Init: /// CHECK-NOT: Callback Load: -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 - -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 /// CHECK-NOT: Callback Fini: diff --git a/openmp/libomptarget/test/ompt/veccopy_wrong_return.c b/openmp/libomptarget/test/ompt/veccopy_wrong_return.c index a51a6dc..eef2094 100644 --- a/openmp/libomptarget/test/ompt/veccopy_wrong_return.c +++ b/openmp/libomptarget/test/ompt/veccopy_wrong_return.c @@ -54,29 +54,10 @@ int main() { return rc; } +/// CHECK: Could not register callback 'ompt_callback_target_data_op' +/// CHECK: Could not register callback 'ompt_callback_target' +/// CHECK: Could not register callback 'ompt_callback_target_submit' + /// CHECK-NOT: Callback Init: /// CHECK-NOT: Callback Load: -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 - -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=1 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=2 -/// CHECK-NOT: Callback Submit: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] req_num_teams=0 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=3 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback DataOp: target_id=[[TARGET_ID:[0-9]+]] host_op_id=[[HOST_OP_ID:[0-9]+]] optype=4 -/// CHECK-NOT: Callback Target: target_id=[[TARGET_ID:[0-9]+]] kind=1 endpoint=2 -/// CHECK-NOT: Callback Fini +/// CHECK-NOT: Callback Fini: diff --git a/openmp/runtime/src/ompt-event-specific.h b/openmp/runtime/src/ompt-event-specific.h index 7736ba8..5ac7f6d 100644 --- a/openmp/runtime/src/ompt-event-specific.h +++ b/openmp/runtime/src/ompt-event-specific.h @@ -55,12 +55,13 @@ #define ompt_callback_implicit_task_implemented ompt_event_MAY_ALWAYS -#define ompt_callback_target_implemented ompt_event_MAY_ALWAYS -#define ompt_callback_target_emi_implemented ompt_event_MAY_ALWAYS -#define ompt_callback_target_data_op_implemented ompt_event_MAY_ALWAYS -#define ompt_callback_target_data_op_emi_implemented ompt_event_MAY_ALWAYS -#define ompt_callback_target_submit_implemented ompt_event_MAY_ALWAYS -#define ompt_callback_target_submit_emi_implemented ompt_event_MAY_ALWAYS +#define ompt_callback_target_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_emi_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_data_op_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_data_op_emi_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_submit_implemented ompt_event_UNIMPLEMENTED +#define ompt_callback_target_submit_emi_implemented ompt_event_UNIMPLEMENTED + #define ompt_callback_control_tool_implemented ompt_event_MAY_ALWAYS #define ompt_callback_device_initialize_implemented ompt_event_MAY_ALWAYS -- cgit v1.1