%exception{
try {
$action
- } catch (armnn::Exception &e) {
+ } catch (const armnn::Exception& e) {
SWIG_exception(SWIG_RuntimeError, const_cast<char*>(e.what()));
}
};
%exception __getitem__ {
try {
$action
- } catch (armnn::InvalidArgumentException &e) {
+ } catch (const armnn::InvalidArgumentException &e) {
SWIG_exception(SWIG_ValueError, const_cast<char*>(e.what()));
} catch (const std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, const_cast<char*>(e.what()));
%exception __setitem__ {
try {
$action
- } catch (armnn::InvalidArgumentException &e) {
+ } catch (const armnn::InvalidArgumentException &e) {
SWIG_exception(SWIG_ValueError, const_cast<char*>(e.what()));
} catch (const std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, const_cast<char*>(e.what()));
{
new SocketProfilingConnection();
}
- catch (armnnProfiling::SocketConnectionException& ex)
+ catch (const armnnProfiling::SocketConnectionException& ex)
{
BOOST_CHECK(ex.GetSocketFd() == 0);
BOOST_CHECK(ex.GetErrorNo() == 111);
{
optimizedNet = armnn::Optimize(*network, computeDevice, runtime->GetDeviceSpec());
}
- catch (armnn::Exception& e)
+ catch (const armnn::Exception& e)
{
std::stringstream message;
message << "armnn::Exception (" << e.what() << ") caught from optimize.";
ARMNN_LOG(info) << "Accuracy Tool ran successfully!";
return 0;
}
- catch (armnn::Exception const & e)
+ catch (const armnn::Exception& e)
{
// Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
// exception of type std::length_error.
std::cerr << "Armnn Error: " << e.what() << std::endl;
return 1;
}
- catch (const std::exception & e)
+ catch (const std::exception& e)
{
// Coverity fix: various boost exceptions can be thrown by methods called by this test.
std::cerr << "WARNING: ModelAccuracyTool-Armnn: An error has occurred when running the "
{
optimizedNet = armnn::Optimize(*network, computeDevice, runtime->GetDeviceSpec());
}
- catch (armnn::Exception& e)
+ catch (const armnn::Exception& e)
{
std::stringstream message;
message << "armnn::Exception ("<<e.what()<<") caught from optimize.";
ARMNN_LOG(info) << "Multiple networks inference ran successfully!";
return 0;
}
- catch (armnn::Exception const& e)
+ catch (const armnn::Exception& e)
{
// Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
// exception of type std::length_error.
}
}
}
- catch (armnn::Exception const& e)
+ catch (const armnn::Exception& e)
{
ARMNN_LOG(fatal) << "Armnn Error: " << e.what();
return EXIT_FAILURE;
static const int LOAD_IMAGE_ERROR = -5;
static const int GENERAL_ERROR = -100;
-#define CHECK_OK(v) \
- do { \
- try { \
- auto r_local = v; \
- if (r_local != 0) { return r_local;} \
- } \
- catch(armnn::Exception e) \
- { \
- ARMNN_LOG(error) << "Oops: " << e.what(); \
- return GENERAL_ERROR; \
- } \
+#define CHECK_OK(v) \
+ do { \
+ try { \
+ auto r_local = v; \
+ if (r_local != 0) { return r_local;} \
+ } \
+ catch (const armnn::Exception& e) \
+ { \
+ ARMNN_LOG(error) << "Oops: " << e.what(); \
+ return GENERAL_ERROR; \
+ } \
} while(0)