Skip to content

Commit

Permalink
Replace unnecessary call_nocheck with call.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongreig committed Oct 7, 2024
1 parent bf4aeaf commit 97a41f4
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions sycl/source/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,11 @@ make_kernel_bundle(ur_native_handle_t NativeHandle,
switch (BinaryType) {
case (UR_PROGRAM_BINARY_TYPE_NONE):
if (State == bundle_state::object) {
auto Res = Adapter->call_nocheck<UrApiKind::urProgramCompile>(
UrProgram, 1, &Dev, nullptr);
Adapter->checkUrResult<errc::build>(Res);
Adapter->call<UrApiKind::urProgramCompile>(UrProgram, 1, &Dev, nullptr);
}

else if (State == bundle_state::executable) {
auto Res = Adapter->call_nocheck<UrApiKind::urProgramBuild>(
UrProgram, 1, &Dev, nullptr);
Adapter->checkUrResult<errc::build>(Res);
Adapter->call<UrApiKind::urProgramBuild>(UrProgram, 1, &Dev, nullptr);
}

break;
Expand All @@ -247,10 +243,9 @@ make_kernel_bundle(ur_native_handle_t NativeHandle,
detail::codeToString(UR_RESULT_ERROR_INVALID_VALUE));
if (State == bundle_state::executable) {
ur_program_handle_t UrLinkedProgram = nullptr;
auto Res = Adapter->call_nocheck<UrApiKind::urProgramLink>(
ContextImpl->getHandleRef(), 1, &Dev, 1, &UrProgram, nullptr,
&UrLinkedProgram);
Adapter->checkUrResult<errc::build>(Res);
Adapter->call<UrApiKind::urProgramLink>(ContextImpl->getHandleRef(), 1,
&Dev, 1, &UrProgram, nullptr,
&UrLinkedProgram);
if (UrLinkedProgram != nullptr) {
UrProgram = UrLinkedProgram;
}
Expand Down

0 comments on commit 97a41f4

Please sign in to comment.