32 ss <<
" at function " << m_Function
33 <<
" [" << m_File <<
':' << m_Line <<
"]";
40 ss <<
" [" << m_File <<
':' << m_Line <<
"]";
49 explicit Exception(
const std::string& message);
52 explicit Exception(
const std::string& message,
58 const std::string& message,
61 virtual const char* what()
const noexcept
override;
64 std::string m_Message;
77 using BackendUnavailableException::BackendUnavailableException;
153 template <
typename ExceptionType>
158 throw ExceptionType(message);
162 template <
typename ExceptionType>
167 throw ExceptionType();
177 template <
typename ExceptionType,
typename ComparedType>
179 const ComparedType& leftHandSide,
180 const ComparedType& rightHandSide)
182 if (!(leftHandSide == rightHandSide))
184 std::stringstream ss;
185 ss << message <<
" : " << leftHandSide <<
" != " << rightHandSide;
186 throw ExceptionType(ss.str());
192 #define CHECK_LOCATION() armnn::CheckLocation(__func__, __FILE__, __LINE__) void ConditionalThrowIfNotEqual(const std::string &message, const ComparedType &leftHandSide, const ComparedType &rightHandSide)
ComparedType must support: operator==(const ComparedType&) operator<<(ostream&, const ComparedType&) ...
std::string AsString() const
Exception(const std::string &message)
Copyright (c) 2020 ARM Limited.
void ConditionalThrow(bool condition, const std::string &message)
std::string FileLine() const
CheckLocation(const char *func, const char *file, unsigned int line)
Base class for all ArmNN exceptions so that users can filter to just those.
Class for non-fatal exceptions raised while initialising a backend.