Skip to content

Commit fe5782b

Browse files
removed catch of bad_alloc per PR feedback
1 parent cb88f4f commit fe5782b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

dpctl-capi/source/dpctl_sycl_context_interface.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,8 @@ size_t DPCTLContext_DeviceCount(__dpctl_keep const DPCTLSyclContextRef CRef)
159159
"input is a nullptr\n";
160160
return 0;
161161
}
162-
try {
163-
auto Devices = Context->get_devices();
164-
return Devices.size();
165-
} catch (std::bad_alloc const &ba) {
166-
// \todo log error
167-
std::cerr << ba.what() << '\n';
168-
return 0;
169-
}
162+
const auto Devices = Context->get_devices();
163+
return Devices.size();
170164
}
171165

172166
bool DPCTLContext_IsHost(__dpctl_keep const DPCTLSyclContextRef CtxRef)

0 commit comments

Comments
 (0)