Skip to content

[SYCL][ABI-break] Remove legacy get member function from event #6570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 16, 2022
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
2 changes: 1 addition & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(SYCL_MINOR_VERSION 7)
set(SYCL_PATCH_VERSION 0)
# Don't forget to re-enable sycl_symbols_windows.dump once we leave ABI-breaking
# window!
set(SYCL_DEV_ABI_VERSION 7)
set(SYCL_DEV_ABI_VERSION 8)
if (SYCL_ADD_DEV_VERSION_POSTFIX)
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
endif()
Expand Down
7 changes: 0 additions & 7 deletions sycl/include/sycl/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ class __SYCL_EXPORT event {

bool operator!=(const event &rhs) const;

/// Returns a valid OpenCL event interoperability handle.
///
/// \return a valid instance of OpenCL cl_event.
#ifdef __SYCL_INTERNAL_API
cl_event get() const;
#endif

/// Checks if this event is a SYCL host event.
///
/// \return true if this event is a SYCL host event.
Expand Down
17 changes: 3 additions & 14 deletions sycl/source/detail/event_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,7 @@ void event_impl::ensureContextInitialized() {
bool event_impl::is_host() {
// Treat all devices that don't support interoperability as host devices to
// avoid attempts to call method get on such events.
return MHostEvent || !MOpenCLInterop;
}

cl_event event_impl::get() {
if (!MOpenCLInterop) {
throw invalid_object_error(
"This instance of event doesn't support OpenCL interoperability.",
PI_ERROR_INVALID_EVENT);
}
getPlugin().call<PiApiKind::piEventRetain>(MEvent);
return pi::cast<cl_event>(MEvent);
return MHostEvent;
}

event_impl::~event_impl() {
Expand Down Expand Up @@ -123,7 +113,6 @@ void event_impl::setStateIncomplete() { MState = HES_NotComplete; }

void event_impl::setContextImpl(const ContextImplPtr &Context) {
MHostEvent = Context->is_host();
MOpenCLInterop = !MHostEvent;
MContext = Context;
MIsContextInitialized = true;
}
Expand All @@ -134,8 +123,8 @@ event_impl::event_impl(std::optional<HostEventState> State)

event_impl::event_impl(RT::PiEvent Event, const context &SyclContext)
: MIsContextInitialized(true), MEvent(Event),
MContext(detail::getSyclObjImpl(SyclContext)), MOpenCLInterop(true),
MHostEvent(false), MIsFlushed(true), MState(HES_Complete) {
MContext(detail::getSyclObjImpl(SyclContext)), MHostEvent(false),
MIsFlushed(true), MState(HES_Complete) {

if (MContext->is_host()) {
throw sycl::invalid_parameter_error(
Expand Down
6 changes: 0 additions & 6 deletions sycl/source/detail/event_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ class event_impl {
/// \return true if this event is a SYCL host event.
bool is_host();

/// Returns a valid OpenCL event interoperability handle.
///
/// \return a valid instance of OpenCL cl_event.
cl_event get();

/// Waits for the event.
///
/// Self is needed in order to pass shared_ptr to Scheduler.
Expand Down Expand Up @@ -231,7 +226,6 @@ class event_impl {
bool MIsContextInitialized = false;
RT::PiEvent MEvent = nullptr;
ContextImplPtr MContext;
bool MOpenCLInterop = false;
bool MHostEvent = true;
std::unique_ptr<HostProfilingInfo> MHostProfilingInfo;
void *MCommand = nullptr;
Expand Down
2 changes: 0 additions & 2 deletions sycl/source/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ bool event::operator==(const event &rhs) const { return rhs.impl == impl; }

bool event::operator!=(const event &rhs) const { return !(*this == rhs); }

cl_event event::get() const { return impl->get(); }

bool event::is_host() const { return impl->is_host(); }

void event::wait() { impl->wait(impl); }
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 @@ -4052,7 +4052,6 @@ _ZNK4sycl3_V15event15getNativeVectorEv
_ZNK4sycl3_V15event18get_profiling_infoINS0_4info15event_profiling11command_endEEENS0_6detail28is_event_profiling_info_descIT_E11return_typeEv
_ZNK4sycl3_V15event18get_profiling_infoINS0_4info15event_profiling13command_startEEENS0_6detail28is_event_profiling_info_descIT_E11return_typeEv
_ZNK4sycl3_V15event18get_profiling_infoINS0_4info15event_profiling14command_submitEEENS0_6detail28is_event_profiling_info_descIT_E11return_typeEv
_ZNK4sycl3_V15event3getEv
_ZNK4sycl3_V15event7is_hostEv
_ZNK4sycl3_V15event8get_infoINS0_4info5event15reference_countEEENS0_6detail18is_event_info_descIT_E11return_typeEv
_ZNK4sycl3_V15event8get_infoINS0_4info5event24command_execution_statusEEENS0_6detail18is_event_info_descIT_E11return_typeEv
Expand Down