Skip to content

Commit

Permalink
Simplify graph aspect checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensuo committed Mar 14, 2024
1 parent c17e6c6 commit 2612638
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions sycl/source/detail/device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,18 +603,8 @@ bool device_impl::has(aspect Aspect) const {
return Result != nullptr;
}
case aspect::ext_oneapi_graph: {
pi_bool SupportsCommandBuffers = false;
bool CallSuccessful =
getPlugin()->call_nocheck<PiApiKind::piDeviceGetInfo>(
MDevice, PI_EXT_ONEAPI_DEVICE_INFO_COMMAND_BUFFER_SUPPORT,
sizeof(SupportsCommandBuffers), &SupportsCommandBuffers,
nullptr) == PI_SUCCESS;
if (!CallSuccessful) {
return PI_FALSE;
}

pi_bool SupportsCommandBufferUpdate = false;
CallSuccessful =
bool CallSuccessful =
getPlugin()->call_nocheck<PiApiKind::piDeviceGetInfo>(
MDevice, PI_EXT_ONEAPI_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT,
sizeof(SupportsCommandBufferUpdate), &SupportsCommandBufferUpdate,
Expand All @@ -623,7 +613,7 @@ bool device_impl::has(aspect Aspect) const {
return PI_FALSE;
}

return SupportsCommandBuffers && SupportsCommandBufferUpdate;
return has(aspect::ext_oneapi_limited_graph) && SupportsCommandBufferUpdate;
}
case aspect::ext_oneapi_limited_graph: {
pi_bool SupportsCommandBuffers = false;
Expand Down

0 comments on commit 2612638

Please sign in to comment.