Skip to content

Commit fabf4f2

Browse files
committed
removed special handling for root devices
Signed-off-by: Byoungro So <[email protected]>
1 parent 20a07ad commit fabf4f2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sycl/source/detail/device_impl.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ device_impl::device_impl(pi_native_handle InteropDeviceHandle,
5858
nullptr);
5959

6060
MIsRootDevice = (nullptr == parent);
61-
if (!MIsRootDevice && !InteroperabilityConstructor) {
61+
if (!InteroperabilityConstructor) {
6262
// TODO catch an exception and put it to list of asynchronous exceptions
6363
// Interoperability Constructor already calls DeviceRetain in
6464
// piextDeviceFromNative.
@@ -77,7 +77,7 @@ device_impl::device_impl(pi_native_handle InteropDeviceHandle,
7777
}
7878

7979
device_impl::~device_impl() {
80-
if (!MIsRootDevice && !MIsHostDevice) {
80+
if (!MIsHostDevice) {
8181
// TODO catch an exception and put it to list of asynchronous exceptions
8282
const detail::plugin &Plugin = getPlugin();
8383
RT::PiResult Err = Plugin.call_nocheck<PiApiKind::piDeviceRelease>(MDevice);
@@ -98,10 +98,9 @@ cl_device_id device_impl::get() const {
9898
PI_INVALID_DEVICE);
9999

100100
const detail::plugin &Plugin = getPlugin();
101-
if (!MIsRootDevice) {
102-
// TODO catch an exception and put it to list of asynchronous exceptions
103-
Plugin.call<PiApiKind::piDeviceRetain>(MDevice);
104-
}
101+
102+
// TODO catch an exception and put it to list of asynchronous exceptions
103+
Plugin.call<PiApiKind::piDeviceRetain>(MDevice);
105104
return pi::cast<cl_device_id>(getNative());
106105
}
107106

0 commit comments

Comments
 (0)