Skip to content

Commit bbca36d

Browse files
[SYCL] address regressions from making backend a property of platform (#9260)
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent a2ed397 commit bbca36d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sycl/source/detail/event_impl.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ class event_impl {
251251

252252
bool isContextInitialized() const noexcept { return MIsContextInitialized; }
253253

254-
ContextImplPtr getContextImplPtr() const { return MContext; }
254+
ContextImplPtr getContextImplPtr() {
255+
ensureContextInitialized();
256+
return MContext;
257+
}
255258

256259
protected:
257260
// When instrumentation is enabled emits trace event for event wait begin and

sycl/unittests/pi/BackendString.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <detail/plugin.hpp>
88

99
namespace pi {
10-
inline const char *GetBackendString(const sycl::detail::plugin &Plugin) {
10+
inline std::string GetBackendString(const sycl::detail::plugin &Plugin) {
1111
std::stringstream Str;
1212
for (sycl::backend Backend :
1313
{sycl::backend::opencl, sycl::backend::ext_oneapi_level_zero,
@@ -17,6 +17,6 @@ inline const char *GetBackendString(const sycl::detail::plugin &Plugin) {
1717
Str << Backend;
1818
}
1919
}
20-
return Str.str().c_str();
20+
return Str.str();
2121
}
2222
} // namespace pi

0 commit comments

Comments
 (0)