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;
158 template <
typename ExceptionType>
163 throw ExceptionType(message);
167 template <
typename ExceptionType>
172 throw ExceptionType();
182 template <
typename ExceptionType,
typename ComparedType>
184 const ComparedType& leftHandSide,
185 const ComparedType& rightHandSide)
187 if (!(leftHandSide == rightHandSide))
189 std::stringstream ss;
190 ss << message <<
" : " << leftHandSide <<
" != " << rightHandSide;
191 throw ExceptionType(ss.str());
197 #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.