diff options
author | Derek Lamberti <derek.lamberti@arm.com> | 2020-02-19 13:25:42 +0000 |
---|---|---|
committer | Derek Lamberti <derek.lamberti@arm.com> | 2020-03-05 09:02:38 +0000 |
commit | dcfc63613054711d58f8bd0d9ea55ccbaf328589 (patch) | |
tree | 8a323dab5d88d65fb653572a5972f585fc1df7fb | |
parent | 9f8cad27f34f31560e55c65451fcd8d4ec2f334e (diff) | |
download | armnn-dcfc63613054711d58f8bd0d9ea55ccbaf328589.tar.gz |
IVGCVSW-4485 Introduce ARMNN_ASSERT(_MSG) macros
Change-Id: Iba372f7311a68877a42e52595430db212c5c9fec
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | include/armnn/utility/Assert.hpp | 21 |
2 files changed, 22 insertions, 0 deletions
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 <cassert> + +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 |