diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-11-13 21:11:31 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-11-13 21:11:31 +0100 |
commit | 03ebf14b97707f425519f46c3bb514f8ef5c93ad (patch) | |
tree | 220921c7d7a170faac6ed585395a640f34ce64f6 /src/utilities | |
parent | 4bac1287f2d49bece72822bf6032e4da56a2dd2d (diff) |
Made the exception dispatch function optionally silent
Diffstat (limited to 'src/utilities')
-rw-r--r-- | src/utilities/clblast_exceptions.cpp | 4 | ||||
-rw-r--r-- | src/utilities/clblast_exceptions.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/utilities/clblast_exceptions.cpp b/src/utilities/clblast_exceptions.cpp index 32526215..8038805d 100644 --- a/src/utilities/clblast_exceptions.cpp +++ b/src/utilities/clblast_exceptions.cpp @@ -45,7 +45,7 @@ RuntimeErrorCode::RuntimeErrorCode(StatusCode status, const std::string &subreas // ================================================================================================= -StatusCode DispatchException() +StatusCode DispatchException(const bool silent) { const char *message = nullptr; StatusCode status; @@ -66,7 +66,7 @@ StatusCode DispatchException() status = StatusCode::kUnknownError; } - if (message) { + if (message && !silent) { fprintf(stderr, "CLBlast: %s\n", message); } return status; diff --git a/src/utilities/clblast_exceptions.hpp b/src/utilities/clblast_exceptions.hpp index a790be9c..5f2edbae 100644 --- a/src/utilities/clblast_exceptions.hpp +++ b/src/utilities/clblast_exceptions.hpp @@ -37,7 +37,7 @@ class RuntimeErrorCode : public ErrorCode<RuntimeError, StatusCode> { // ================================================================================================= // Handles (most of the) runtime exceptions and converts them to StatusCode -StatusCode DispatchException(); +StatusCode DispatchException(const bool silent = false); // Handles remaining exceptions and converts them to StatusCode::kUnhandledError StatusCode DispatchExceptionForC(); |