Skip to content

Commit 791c8b5

Browse files
committed
fix for subdevice related tests
1 parent ed57c83 commit 791c8b5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sycl/source/detail/device_impl.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ class device_impl {
242242
bool MIsAssertFailSupported = false;
243243
mutable std::string MDeviceName;
244244
mutable std::once_flag MDeviceNameFlag;
245+
246+
friend bool sameDev(const std::shared_ptr<device_impl> &LHS, const std::shared_ptr<device_impl> &RHS);
245247
}; // class device_impl
246248

247249
} // namespace detail

sycl/source/detail/scheduler/graph_builder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ static bool sameCtx(const ContextImplPtr &LHS, const ContextImplPtr &RHS) {
4646
// allocation on the host
4747
return LHS == RHS || (LHS->is_host() && RHS->is_host());
4848
}
49-
static bool sameDev(const DeviceImplPtr &LHS, const DeviceImplPtr &RHS) {
50-
return LHS == RHS;
49+
bool sameDev(const DeviceImplPtr &LHS, const DeviceImplPtr &RHS) {
50+
RT::PiDevice LHSroot = LHS->MRootDevice == nullptr ? LHS->MDevice : LHS->MRootDevice;
51+
RT::PiDevice RHSroot = RHS->MRootDevice == nullptr ? RHS->MDevice : RHS->MRootDevice;
52+
return LHSroot == RHSroot;
5153
}
5254

5355
/// Checks if current requirement is requirement for sub buffer.

0 commit comments

Comments
 (0)