Skip to content

Commit

Permalink
[SYCL] Make device comparison method to analyze impl not native handl…
Browse files Browse the repository at this point in the history
…es (#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 <kseniya.tikhomirova@intel.com>
  • Loading branch information
KseniyaTikhomirova authored Sep 29, 2022
1 parent 86f709c commit 9baa9d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions sycl/include/sycl/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ class __SYCL_EXPORT device {
template <class T>
friend T detail::createSyclObjFromImpl(decltype(T::impl) ImplObj);

friend auto detail::getDeviceComparisonLambda();

template <backend BackendName, class SyclObjectT>
friend auto get_native(const SyclObjectT &Obj)
-> backend_return_t<BackendName, SyclObjectT>;
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/kernel_bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ bool kernel_bundle_plain::is_specialization_constant_set(
const std::vector<device>
removeDuplicateDevices(const std::vector<device> &Devs) {
auto compareDevices = [](device a, device b) {
return getSyclObjImpl(a)->getHandleRef() <
getSyclObjImpl(b)->getHandleRef();
return getSyclObjImpl(a) < getSyclObjImpl(b);
};
std::set<device, decltype(compareDevices)> UniqueDeviceSet(
Devs.begin(), Devs.end(), compareDevices);
std::vector<device> UniqueDevices(UniqueDeviceSet.begin(),
UniqueDeviceSet.end());

return UniqueDevices;
}

Expand Down

0 comments on commit 9baa9d9

Please sign in to comment.