Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NVIDIA] Add ov::Exception wrapper #869

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modules/nvidia_plugin/src/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
namespace ov {
namespace nvidia_gpu {
namespace {
class OVExceptionWrapper : public ov::Exception {
public:
OVExceptionWrapper(const std::string& what) : ov::Exception(what) {}
};

template <typename T>
[[gnu::cold, noreturn]] void throw_exception(const std::string& msg,
const std::experimental::source_location& location) {
Expand All @@ -20,7 +25,7 @@ template <typename T>

[[gnu::cold, noreturn]] void throw_ov_exception(const std::string& msg,
const std::experimental::source_location& location) {
throw_exception<ov::Exception>(msg, location);
throw_exception<OVExceptionWrapper>(msg, location);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could create specialization of this throw_exception which throws via Exception::create

}

[[gnu::cold]] void logError(const std::string& /*msg*/, const std::experimental::source_location& /*location*/) {
Expand Down
Loading