blob: 508cdc032e3140534377cd98b668afff8396df76 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
Pablo Marquez Tello1bf35f52023-03-31 15:57:43 +01002// Copyright © 2017,2023 Arm Ltd and Contributors. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
5
6#include <iostream>
7#include <sstream>
Pablo Marquez Tello1bf35f52023-03-31 15:57:43 +01008#include <cstdint>
telsoa01c577f2c2018-08-31 09:22:23 +01009#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())