From f91d2898fc92e5329ec65342a147b2acffebd1a7 Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Fri, 19 Apr 2024 15:49:41 +0100 Subject: [PATCH] [ABI-Break][SYCL] Remove unused getOrWaitEvents helper. --- sycl/include/sycl/detail/helpers.hpp | 8 +---- sycl/source/detail/event_impl.hpp | 4 --- sycl/source/detail/helpers.cpp | 40 ------------------------- sycl/test/abi/sycl_symbols_linux.dump | 1 - sycl/test/abi/sycl_symbols_windows.dump | 1 - 5 files changed, 1 insertion(+), 53 deletions(-) diff --git a/sycl/include/sycl/detail/helpers.hpp b/sycl/include/sycl/detail/helpers.hpp index 7e1fcb00a8aed..db54caa105f45 100644 --- a/sycl/include/sycl/detail/helpers.hpp +++ b/sycl/include/sycl/detail/helpers.hpp @@ -42,12 +42,6 @@ namespace detail { class buffer_impl; class context_impl; -// The function returns list of events that can be passed to OpenCL API as -// dependency list and waits for others. -__SYCL_EXPORT std::vector -getOrWaitEvents(std::vector DepEvents, - std::shared_ptr Context); - __SYCL_EXPORT void waitEvents(std::vector DepEvents); __SYCL_EXPORT void @@ -55,7 +49,7 @@ markBufferAsInternal(const std::shared_ptr &BufImpl); template T *declptr() { return static_cast(nullptr); } -// Function to get of store id, item, nd_item, group for the host implementation +// Function to get or store id, item, nd_item, group for the host implementation // Pass nullptr to get stored object. Pass valid address to store object template T get_or_store(const T *obj) { static thread_local auto stored = *obj; diff --git a/sycl/source/detail/event_impl.hpp b/sycl/source/detail/event_impl.hpp index 38609e82ed14c..40dd7d63782e3 100644 --- a/sycl/source/detail/event_impl.hpp +++ b/sycl/source/detail/event_impl.hpp @@ -392,10 +392,6 @@ class event_impl { // sycl::detail::pi::PiExtCommandBuffer the command-buffer command // (if any) associated with that submission is stored here. sycl::detail::pi::PiExtCommandBufferCommand MCommandBufferCommand = nullptr; - - friend std::vector - getOrWaitEvents(std::vector DepEvents, - std::shared_ptr Context); }; } // namespace detail diff --git a/sycl/source/detail/helpers.cpp b/sycl/source/detail/helpers.cpp index 1bdb2ddbd4697..59625db039d07 100644 --- a/sycl/source/detail/helpers.cpp +++ b/sycl/source/detail/helpers.cpp @@ -21,46 +21,6 @@ namespace sycl { inline namespace _V1 { using ContextImplPtr = std::shared_ptr; namespace detail { -// TODO: remove from public header files and implementation during the next ABI -// Breaking window. Not used any more. -std::vector -getOrWaitEvents(std::vector DepEvents, ContextImplPtr Context) { - std::vector Events; - for (auto SyclEvent : DepEvents) { - auto SyclEventImplPtr = detail::getSyclObjImpl(SyclEvent); - // throwaway events created with empty constructor will not have a context - // (which is set lazily) calling getContextImpl() would set that - // context, which we wish to avoid as it is expensive. - if ((!SyclEventImplPtr->isContextInitialized() && - !SyclEventImplPtr->is_host()) || - SyclEventImplPtr->isNOP()) { - continue; - } - // The fusion command and its event are associated with a non-host context, - // but still does not produce a PI event. - bool NoPiEvent = - SyclEventImplPtr->MCommand && - !static_cast(SyclEventImplPtr->MCommand)->producesPiEvent(); - if (SyclEventImplPtr->is_host() || - SyclEventImplPtr->getContextImpl() != Context || NoPiEvent) { - // Call wait, because the command for the event might not have been - // enqueued when kernel fusion is happening. - SyclEventImplPtr->wait(SyclEventImplPtr); - } else { - // In this path nullptr native event means that the command has not been - // enqueued. It may happen if async enqueue in a host task is involved. - // This should affect only shortcut functions, which bypass the graph. - if (SyclEventImplPtr->getHandleRef() == nullptr) { - std::vector AuxCmds; - Scheduler::getInstance().enqueueCommandForCG(SyclEventImplPtr, AuxCmds, - BLOCKING); - } - Events.push_back(SyclEventImplPtr->getHandleRef()); - } - } - return Events; -} - void waitEvents(std::vector DepEvents) { for (auto SyclEvent : DepEvents) { detail::getSyclObjImpl(SyclEvent)->waitInternal(); diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 28944dad6adba..d5c32b59a8bef 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3322,7 +3322,6 @@ _ZN4sycl3_V16detail14tls_code_loc_tC2ERKNS1_13code_locationE _ZN4sycl3_V16detail14tls_code_loc_tC2Ev _ZN4sycl3_V16detail14tls_code_loc_tD1Ev _ZN4sycl3_V16detail14tls_code_loc_tD2Ev -_ZN4sycl3_V16detail15getOrWaitEventsESt6vectorINS0_5eventESaIS3_EESt10shared_ptrINS1_12context_implEE _ZN4sycl3_V16detail16AccessorBaseHost10getAccDataEv _ZN4sycl3_V16detail16AccessorBaseHost14getAccessRangeEv _ZN4sycl3_V16detail16AccessorBaseHost14getMemoryRangeEv diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index 5dc49a037a721..d8988afbb0dc5 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -4237,7 +4237,6 @@ ?getOffset@AccessorBaseHost@detail@_V1@sycl@@QEBAAEBV?$id@$02@34@XZ ?getOrCreateSampler@sampler_impl@detail@_V1@sycl@@QEAAPEAU_pi_sampler@@AEBVcontext@34@@Z ?getOrInsertHandlerKernelBundle@handler@_V1@sycl@@AEBA?AV?$shared_ptr@Vkernel_bundle_impl@detail@_V1@sycl@@@std@@_N@Z -?getOrWaitEvents@detail@_V1@sycl@@YA?AV?$vector@PEAU_pi_event@@V?$allocator@PEAU_pi_event@@@std@@@std@@V?$vector@Vevent@_V1@sycl@@V?$allocator@Vevent@_V1@sycl@@@std@@@5@V?$shared_ptr@Vcontext_impl@detail@_V1@sycl@@@5@@Z ?getPitch@SampledImageAccessorBaseHost@detail@_V1@sycl@@QEBA?AV?$id@$02@34@XZ ?getPitch@UnsampledImageAccessorBaseHost@detail@_V1@sycl@@QEBA?AV?$id@$02@34@XZ ?getPixelCoordLinearFiltMode@detail@_V1@sycl@@YA?AV?$vec@H$07@23@V?$vec@M$03@23@W4addressing_mode@23@V?$range@$02@23@AEAV523@@Z