Skip to content

Commit bdcd30e

Browse files
committed
Address review comment. Pass the device_impl shared_ptr reference
directly, instead of creating the device object instance.
1 parent 558041f commit bdcd30e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sycl/source/detail/graph_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,10 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> {
919919
/// @return Device associated with graph.
920920
sycl::device getDevice() const { return MDevice; }
921921

922+
const DeviceImplPtr &getDeviceImplPtr() const {
923+
return getSyclObjImpl(MDevice);
924+
}
925+
922926
/// List of root nodes.
923927
std::set<std::weak_ptr<node_impl>, std::owner_less<std::weak_ptr<node_impl>>>
924928
MRoots;

sycl/source/handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,8 +2012,8 @@ void handler::setUserFacingNodeType(ext::oneapi::experimental::node_type Type) {
20122012
}
20132013

20142014
std::optional<std::array<size_t, 3>> handler::getMaxWorkGroups() {
2015-
device Device = detail::getDeviceFromHandler(*this);
2016-
const auto &DeviceImpl = detail::getSyclObjImpl(Device);
2015+
const auto &DeviceImpl =
2016+
MQueue ? MQueue->getDeviceImplPtr() : impl->MGraph->getDeviceImplPtr();
20172017
std::array<size_t, 3> UrResult = {};
20182018
auto Ret = DeviceImpl->getAdapter()->call_nocheck<UrApiKind::urDeviceGetInfo>(
20192019
DeviceImpl->getHandleRef(),

0 commit comments

Comments
 (0)