Skip to content

Commit 9baa9d9

Browse files
[SYCL] Make device comparison method to analyze impl not native handles (#6880)
Initial issue was sycl::link failure with many devices passed when esimd_emulator backend is enabled. esimd_emulator does not have getNative method implemented while we checked object equality by comparison of native handles. It seems to be not fully valid and we need to check it using operator. GetNative implementation for esimd_emulator is not needed. Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 86f709c commit 9baa9d9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

sycl/include/sycl/device.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ class __SYCL_EXPORT device {
234234
template <class T>
235235
friend T detail::createSyclObjFromImpl(decltype(T::impl) ImplObj);
236236

237-
friend auto detail::getDeviceComparisonLambda();
238-
239237
template <backend BackendName, class SyclObjectT>
240238
friend auto get_native(const SyclObjectT &Obj)
241239
-> backend_return_t<BackendName, SyclObjectT>;

sycl/source/kernel_bundle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ bool kernel_bundle_plain::is_specialization_constant_set(
116116
const std::vector<device>
117117
removeDuplicateDevices(const std::vector<device> &Devs) {
118118
auto compareDevices = [](device a, device b) {
119-
return getSyclObjImpl(a)->getHandleRef() <
120-
getSyclObjImpl(b)->getHandleRef();
119+
return getSyclObjImpl(a) < getSyclObjImpl(b);
121120
};
122121
std::set<device, decltype(compareDevices)> UniqueDeviceSet(
123122
Devs.begin(), Devs.end(), compareDevices);
124123
std::vector<device> UniqueDevices(UniqueDeviceSet.begin(),
125124
UniqueDeviceSet.end());
125+
126126
return UniqueDevices;
127127
}
128128

0 commit comments

Comments
 (0)