Skip to content

Commit 068a1f1

Browse files
committed
[SYCL] keep old version until can break ABI
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent 3b97d3c commit 068a1f1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

sycl/source/backend/level_zero.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ __SYCL_EXPORT device make_device(const platform &Platform,
4747

4848
//----------------------------------------------------------------------------
4949
// Implementation of level_zero::make<context>
50+
// TODO: remove this version (without ownership) when allowed to break ABI.
51+
__SYCL_EXPORT context make_context(const vector_class<device> &DeviceList,
52+
pi_native_handle NativeHandle) {
53+
const auto &Plugin = pi::getPlugin<backend::level_zero>();
54+
// Create PI context first.
55+
pi_context PiContext;
56+
vector_class<pi_device> DeviceHandles;
57+
for (auto Dev : DeviceList) {
58+
DeviceHandles.push_back(detail::getSyclObjImpl(Dev)->getHandleRef());
59+
}
60+
Plugin.call<PiApiKind::piextContextCreateWithNativeHandle>(
61+
NativeHandle, DeviceHandles.size(), DeviceHandles.data(), false,
62+
&PiContext);
63+
// Construct the SYCL context from PI context.
64+
return detail::createSyclObjFromImpl<context>(
65+
std::make_shared<context_impl>(PiContext, async_handler{}, Plugin));
66+
}
67+
5068
__SYCL_EXPORT context make_context(const vector_class<device> &DeviceList,
5169
pi_native_handle NativeHandle,
5270
bool KeepOwnership) {

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3592,6 +3592,7 @@ _ZN2cl10__host_std9u_sub_satEmm
35923592
_ZN2cl10__host_std9u_sub_satEtt
35933593
_ZN2cl4sycl10level_zero10make_queueERKNS0_7contextEm
35943594
_ZN2cl4sycl10level_zero11make_deviceERKNS0_8platformEm
3595+
_ZN2cl4sycl10level_zero12make_contextERKSt6vectorINS0_6deviceESaIS3_EEm
35953596
_ZN2cl4sycl10level_zero12make_contextERKSt6vectorINS0_6deviceESaIS3_EEmb
35963597
_ZN2cl4sycl10level_zero12make_programERKNS0_7contextEm
35973598
_ZN2cl4sycl10level_zero13make_platformEm

0 commit comments

Comments
 (0)