blob: 8e3550c70f924628b8759f710623033d9acc21a9 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5
6#include <iostream>
7#include <sstream>
8
9#include <armnn/Exceptions.hpp>
10
11namespace armnnUtils
12{
13
14void CheckValidSize(std::initializer_list<size_t> validInputCounts,
15 size_t actualValue,
16 const char* validExpr,
17 const char* actualExpr,
18 const armnn::CheckLocation& location);
19
20uint32_t NonNegative(const char* expr,
21 int32_t value,
22 const armnn::CheckLocation& location);
23
24int32_t VerifyInt32(const char* expr,
25 int64_t value,
26 const armnn::CheckLocation& location);
27
28}//armnnUtils
29
30#define CHECKED_INT32(VALUE) armnnUtils::VerifyInt32(#VALUE, VALUE, CHECK_LOCATION())
31
32#define CHECK_VALID_SIZE(ACTUAL, ...) \
33armnnUtils::CheckValidSize({__VA_ARGS__}, ACTUAL, #__VA_ARGS__, #ACTUAL, CHECK_LOCATION())
34
35#define CHECKED_NON_NEGATIVE(VALUE) armnnUtils::NonNegative(#VALUE, VALUE, CHECK_LOCATION())