Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions sycl/include/sycl/detail/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,14 @@ 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<sycl::detail::pi::PiEvent>
getOrWaitEvents(std::vector<sycl::event> DepEvents,
std::shared_ptr<sycl::detail::context_impl> Context);

__SYCL_EXPORT void waitEvents(std::vector<sycl::event> DepEvents);

__SYCL_EXPORT void
markBufferAsInternal(const std::shared_ptr<buffer_impl> &BufImpl);

template <typename T> T *declptr() { return static_cast<T *>(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 <typename T> T get_or_store(const T *obj) {
static thread_local auto stored = *obj;
Expand Down
4 changes: 0 additions & 4 deletions sycl/source/detail/event_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,6 @@ class event_impl {
// allows for profiling, even if the queue does not have profiling enabled.
bool MProfilingTagEvent = false;

friend std::vector<sycl::detail::pi::PiEvent>
getOrWaitEvents(std::vector<sycl::event> DepEvents,
std::shared_ptr<sycl::detail::context_impl> Context);

std::atomic_bool MIsEnqueued{false};

// Events constructed without a context will lazily use the default context
Expand Down
38 changes: 0 additions & 38 deletions sycl/source/detail/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,6 @@ namespace sycl {
inline namespace _V1 {
using ContextImplPtr = std::shared_ptr<sycl::detail::context_impl>;
namespace detail {
// TODO: remove from public header files and implementation during the next ABI
// Breaking window. Not used any more.
std::vector<sycl::detail::pi::PiEvent>
getOrWaitEvents(std::vector<sycl::event> DepEvents, ContextImplPtr Context) {
std::vector<sycl::detail::pi::PiEvent> 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->isDefaultConstructed() || 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<Command *>(SyclEventImplPtr->MCommand)->producesPiEvent();
if (SyclEventImplPtr->isHost() ||
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<Command *> AuxCmds;
Scheduler::getInstance().enqueueCommandForCG(SyclEventImplPtr, AuxCmds,
BLOCKING);
}
Events.push_back(SyclEventImplPtr->getHandleRef());
}
}
return Events;
}

void waitEvents(std::vector<sycl::event> DepEvents) {
for (auto SyclEvent : DepEvents) {
detail::getSyclObjImpl(SyclEvent)->waitInternal();
Expand Down
1 change: 0 additions & 1 deletion sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -3251,7 +3251,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
Expand Down
1 change: 0 additions & 1 deletion sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -4141,7 +4141,6 @@
?getOffset@AccessorBaseHost@detail@_V1@sycl@@QEAAAEAV?$id@$02@34@XZ
?getOffset@AccessorBaseHost@detail@_V1@sycl@@QEBAAEBV?$id@$02@34@XZ
?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
Expand Down