Skip to content

Commit

Permalink
Fix ABI break
Browse files Browse the repository at this point in the history
- moved handler::MIsTopCodeLoc to handler_impl
- updated new symbols in sycl_symbols_{linux,windows}.dump
  • Loading branch information
Guy Zadickario committed Sep 24, 2024
1 parent 8d202f2 commit 9d0e27e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 8 deletions.
8 changes: 3 additions & 5 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,9 @@ class __SYCL_EXPORT handler {

/// Saves the location of user's code passed in \p CodeLoc for future usage in
/// finalize() method.
void saveCodeLoc(detail::code_location CodeLoc, bool IsTopCodeLoc) {
MCodeLoc = CodeLoc;
MIsTopCodeLoc = IsTopCodeLoc;
}
void saveCodeLoc(detail::code_location CodeLoc);
void saveCodeLoc(detail::code_location CodeLoc, bool IsTopCodeLoc);
void copyCodeLoc(const handler &other);

/// Constructs CG object of specific type, passes it to Scheduler and
/// returns sycl::event object representing the command group.
Expand Down Expand Up @@ -3393,7 +3392,6 @@ class __SYCL_EXPORT handler {
std::unique_ptr<detail::HostKernelBase> MHostKernel;

detail::code_location MCodeLoc = {};
bool MIsTopCodeLoc = true;
bool MIsFinalized = false;
event MLastEvent;

Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ template <class FunctorTy> void withAuxHandler(handler &CGH, FunctorTy Func) {
handler AuxHandler(CGH.MQueue, CGH.eventNeeded());
if (!createSyclObjFromImpl<queue>(CGH.MQueue).is_in_order())
AuxHandler.depends_on(E);
AuxHandler.saveCodeLoc(CGH.MCodeLoc, CGH.MIsTopCodeLoc);
AuxHandler.copyCodeLoc(CGH);
Func(AuxHandler);
CGH.MLastEvent = AuxHandler.finalize();
return;
Expand Down
3 changes: 3 additions & 0 deletions sycl/source/detail/handler_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ class handler_impl {
/// The list of valid SYCL events that need to complete
/// before barrier command can be executed
std::vector<detail::EventImplPtr> MEventsWaitWithBarrier;

/// True if MCodeLoc is sycl entry point code location
bool MIsTopCodeLoc = true;
};

} // namespace detail
Expand Down
17 changes: 15 additions & 2 deletions sycl/source/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ event handler::finalize() {
// uint32_t StreamID, uint64_t InstanceID, xpti_td* TraceEvent,
int32_t StreamID = xptiRegisterStream(detail::SYCL_STREAM_NAME);
auto [CmdTraceEvent, InstanceID] = emitKernelInstrumentationData(
StreamID, MKernel, MCodeLoc, MIsTopCodeLoc, MKernelName.c_str(),
StreamID, MKernel, MCodeLoc, impl->MIsTopCodeLoc, MKernelName.c_str(),
MQueue, impl->MNDRDesc, KernelBundleImpPtr, impl->MArgs);
auto EnqueueKernel = [&, CmdTraceEvent = CmdTraceEvent,
InstanceID = InstanceID]() {
Expand Down Expand Up @@ -517,7 +517,7 @@ event handler::finalize() {

// Propagate MIsTopCodeLoc state to CommandGroup.
// Will be used for XPTI payload generation for CG's related events.
CommandGroup->MIsTopCodeLoc = MIsTopCodeLoc;
CommandGroup->MIsTopCodeLoc = impl->MIsTopCodeLoc;

// If there is a graph associated with the handler we are in the explicit
// graph mode, so we store the CG instead of submitting it to the scheduler,
Expand Down Expand Up @@ -1985,5 +1985,18 @@ void handler::setNDRangeDescriptorPadded(sycl::range<3> NumWorkItems,
impl->MNDRDesc = NDRDescT{NumWorkItems, LocalSize, Offset, Dims};
}

void handler::saveCodeLoc(detail::code_location CodeLoc, bool IsTopCodeLoc) {
MCodeLoc = CodeLoc;
impl->MIsTopCodeLoc = IsTopCodeLoc;
}
void handler::saveCodeLoc(detail::code_location CodeLoc) {
MCodeLoc = CodeLoc;
impl->MIsTopCodeLoc = true;
}
void handler::copyCodeLoc(const handler &other) {
MCodeLoc = other.MCodeLoc;
impl->MIsTopCodeLoc = other.impl->MIsTopCodeLoc;
}

} // namespace _V1
} // namespace sycl
8 changes: 8 additions & 0 deletions sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -3120,7 +3120,9 @@ _ZN4sycl3_V15queue10mem_adviseEPKvmiRKNS0_6detail13code_locationE
_ZN4sycl3_V15queue10mem_adviseEPKvmiRKSt6vectorINS0_5eventESaIS5_EERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue10wait_proxyERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue11submit_implESt8functionIFvRNS0_7handlerEEERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue11submit_implESt8functionIFvRNS0_7handlerEEERKNS0_6detail13code_locationEb
_ZN4sycl3_V15queue11submit_implESt8functionIFvRNS0_7handlerEEES1_RKNS0_6detail13code_locationE
_ZN4sycl3_V15queue11submit_implESt8functionIFvRNS0_7handlerEEES1_RKNS0_6detail13code_locationEb
_ZN4sycl3_V15queue15ext_oneapi_prodEv
_ZN4sycl3_V15queue18throw_asynchronousEv
_ZN4sycl3_V15queue20memcpyToDeviceGlobalEPvPKvbmmRKSt6vectorINS0_5eventESaIS6_EE
Expand All @@ -3129,8 +3131,11 @@ _ZN4sycl3_V15queue22memcpyFromDeviceGlobalEPvPKvbmmRKSt6vectorINS0_5eventESaIS6_
_ZN4sycl3_V15queue25ext_oneapi_submit_barrierERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue25ext_oneapi_submit_barrierERKSt6vectorINS0_5eventESaIS3_EERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue25submit_without_event_implESt8functionIFvRNS0_7handlerEEERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue25submit_without_event_implESt8functionIFvRNS0_7handlerEEERKNS0_6detail13code_locationEb
_ZN4sycl3_V15queue27submit_impl_and_postprocessESt8functionIFvRNS0_7handlerEEERKNS0_6detail13code_locationERKS2_IFvbbRNS0_5eventEEE
_ZN4sycl3_V15queue27submit_impl_and_postprocessESt8functionIFvRNS0_7handlerEEERKNS0_6detail13code_locationERKS2_IFvbbRNS0_5eventEEEb
_ZN4sycl3_V15queue27submit_impl_and_postprocessESt8functionIFvRNS0_7handlerEEES1_RKNS0_6detail13code_locationERKS2_IFvbbRNS0_5eventEEE
_ZN4sycl3_V15queue27submit_impl_and_postprocessESt8functionIFvRNS0_7handlerEEES1_RKNS0_6detail13code_locationERKS2_IFvbbRNS0_5eventEEEb
_ZN4sycl3_V15queue29ext_oneapi_set_external_eventERKNS0_5eventE
_ZN4sycl3_V15queue6memcpyEPvPKvmNS0_5eventERKNS0_6detail13code_locationE
_ZN4sycl3_V15queue6memcpyEPvPKvmRKNS0_6detail13code_locationE
Expand Down Expand Up @@ -3466,6 +3471,9 @@ _ZN4sycl3_V17handler10mem_adviseEPKvmi
_ZN4sycl3_V17handler10processArgEPvRKNS0_6detail19kernel_param_kind_tEimRmbb
_ZN4sycl3_V17handler11SetHostTaskEOSt8functionIFvNS0_14interop_handleEEE
_ZN4sycl3_V17handler11SetHostTaskEOSt8functionIFvvEE
_ZN4sycl3_V17handler11copyCodeLocERKS1_
_ZN4sycl3_V17handler11saveCodeLocENS0_6detail13code_locationE
_ZN4sycl3_V17handler11saveCodeLocENS0_6detail13code_locationEb
_ZN4sycl3_V17handler11storeRawArgEPKvm
_ZN4sycl3_V17handler12addReductionERKSt10shared_ptrIKvE
_ZN4sycl3_V17handler13getKernelNameEv
Expand Down
8 changes: 8 additions & 0 deletions sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -3729,6 +3729,7 @@
?constructorNotification@detail@_V1@sycl@@YAXPEAX0W4target@access@23@W4mode@523@AEBUcode_location@123@@Z
?contains_specialization_constants@kernel_bundle_plain@detail@_V1@sycl@@QEBA_NXZ
?contextSetExtendedDeleter@pi@detail@_V1@sycl@@YAXAEBVcontext@34@P6AXPEAX@Z1@Z
?copyCodeLoc@handler@_V1@sycl@@AEAAXAEBV123@@Z
?cpu_selector_v@_V1@sycl@@YAHAEBVdevice@12@@Z
?create_image@experimental@oneapi@ext@_V1@sycl@@YA?AUsampled_image_handle@12345@AEAVimage_mem@12345@AEBUbindless_image_sampler@12345@AEBUimage_descriptor@12345@AEBVdevice@45@AEBVcontext@45@@Z
?create_image@experimental@oneapi@ext@_V1@sycl@@YA?AUsampled_image_handle@12345@AEAVimage_mem@12345@AEBUbindless_image_sampler@12345@AEBUimage_descriptor@12345@AEBVqueue@45@@Z
Expand Down Expand Up @@ -4082,6 +4083,7 @@
?isPathPresent@OSUtil@detail@_V1@sycl@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z
?isPlaceholder@AccessorBaseHost@detail@_V1@sycl@@QEBA_NXZ
?isStateExplicitKernelBundle@handler@_V1@sycl@@AEBA_NXZ
?isToplevel@tls_code_loc_t@detail@_V1@sycl@@QEBA_NXZ
?isValidModeForDestinationAccessor@handler@_V1@sycl@@CA_NW4mode@access@23@@Z
?isValidModeForSourceAccessor@handler@_V1@sycl@@CA_NW4mode@access@23@@Z
?isValidTargetForExplicitOp@handler@_V1@sycl@@CA_NW4target@access@23@@Z
Expand Down Expand Up @@ -4201,6 +4203,7 @@
?sampledImageConstructorNotification@image_plain@detail@_V1@sycl@@IEAAXAEBUcode_location@234@PEAXPEBXIQEA_KW4image_format@34@AEBUimage_sampler@34@@Z
?sampledImageDestructorNotification@image_plain@detail@_V1@sycl@@IEAAXPEAX@Z
?saveCodeLoc@handler@_V1@sycl@@AEAAXUcode_location@detail@23@@Z
?saveCodeLoc@handler@_V1@sycl@@AEAAXUcode_location@detail@23@_N@Z
?select_device@detail@_V1@sycl@@YA?AVdevice@23@AEBV?$function@$$A6AHAEBVdevice@_V1@sycl@@@Z@std@@@Z
?select_device@detail@_V1@sycl@@YA?AVdevice@23@AEBV?$function@$$A6AHAEBVdevice@_V1@sycl@@@Z@std@@AEBVcontext@23@@Z
?select_device@device_selector@_V1@sycl@@UEBA?AVdevice@23@XZ
Expand Down Expand Up @@ -4249,10 +4252,15 @@
?storeRawArg@handler@_V1@sycl@@AEAAPEAXPEBX_K@Z
?stringifyErrorCode@detail@_V1@sycl@@YAPEBDH@Z
?submit_impl@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@AEBUcode_location@detail@23@@Z
?submit_impl@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@AEBUcode_location@detail@23@_N@Z
?submit_impl@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@V123@AEBUcode_location@detail@23@@Z
?submit_impl@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@V123@AEBUcode_location@detail@23@_N@Z
?submit_impl_and_postprocess@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@AEBUcode_location@detail@23@AEBV?$function@$$A6AX_N0AEAVevent@_V1@sycl@@@Z@6@@Z
?submit_impl_and_postprocess@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@AEBUcode_location@detail@23@AEBV?$function@$$A6AX_N0AEAVevent@_V1@sycl@@@Z@6@_N@Z
?submit_impl_and_postprocess@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@V123@AEBUcode_location@detail@23@AEBV?$function@$$A6AX_N0AEAVevent@_V1@sycl@@@Z@6@@Z
?submit_impl_and_postprocess@queue@_V1@sycl@@AEAA?AVevent@23@V?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@V123@AEBUcode_location@detail@23@AEBV?$function@$$A6AX_N0AEAVevent@_V1@sycl@@@Z@6@_N@Z
?submit_without_event_impl@queue@_V1@sycl@@AEAAXV?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@AEBUcode_location@detail@23@@Z
?submit_without_event_impl@queue@_V1@sycl@@AEAAXV?$function@$$A6AXAEAVhandler@_V1@sycl@@@Z@std@@AEBUcode_location@detail@23@_N@Z
?supportsUSMFill2D@handler@_V1@sycl@@AEAA_NXZ
?supportsUSMMemcpy2D@handler@_V1@sycl@@AEAA_NXZ
?supportsUSMMemset2D@handler@_V1@sycl@@AEAA_NXZ
Expand Down

0 comments on commit 9d0e27e

Please sign in to comment.