From dcfc63613054711d58f8bd0d9ea55ccbaf328589 Mon Sep 17 00:00:00 2001 From: Derek Lamberti Date: Wed, 19 Feb 2020 13:25:42 +0000 Subject: IVGCVSW-4485 Introduce ARMNN_ASSERT(_MSG) macros Change-Id: Iba372f7311a68877a42e52595430db212c5c9fec Signed-off-by: Derek Lamberti --- CMakeLists.txt | 1 + include/armnn/utility/Assert.hpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 include/armnn/utility/Assert.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index b85030ac5a..2f8761aa94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,6 +247,7 @@ list(APPEND armnn_sources include/armnn/Version.hpp include/armnn/profiling/IProfilingGuidGenerator.hpp include/armnn/profiling/ISendTimelinePacket.hpp + include/armnn/utility/Assert.hpp include/armnn/utility/IgnoreUnused.hpp profiling/common/include/SocketConnectionException.hpp src/armnn/layers/LayerCloneBase.hpp diff --git a/include/armnn/utility/Assert.hpp b/include/armnn/utility/Assert.hpp new file mode 100644 index 0000000000..4d2f47b90b --- /dev/null +++ b/include/armnn/utility/Assert.hpp @@ -0,0 +1,21 @@ +// +// Copyright © 2020 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include + +namespace armnn +{ + +#ifndef NDEBUG +# define ARMNN_ASSERT(COND) assert(COND) +# define ARMNN_ASSERT_MSG(COND, MSG) assert(COND && MSG) +#else +# define ARMNN_ASSERT(COND) +# define ARMNN_ASSERT_MSG(COND, MSG) +#endif + +} //namespace armnn \ No newline at end of file -- cgit v1.2.1