ArmNN
 24.08
VerificationHelpers.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017,2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <iostream>
7 #include <sstream>
8 #include <cstdint>
9 #include <armnn/Exceptions.hpp>
10 
11 namespace armnnUtils
12 {
13 
14 void 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 
20 uint32_t NonNegative(const char* expr,
21  int32_t value,
22  const armnn::CheckLocation& location);
23 
24 int32_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, ...) \
33 armnnUtils::CheckValidSize({__VA_ARGS__}, ACTUAL, #__VA_ARGS__, #ACTUAL, CHECK_LOCATION())
34 
35 #define CHECKED_NON_NEGATIVE(VALUE) armnnUtils::NonNegative(#VALUE, VALUE, CHECK_LOCATION())
armnnUtils::NonNegative
uint32_t NonNegative(const char *expr, int32_t value, const CheckLocation &location)
Definition: VerificationHelpers.cpp:35
armnnUtils::CheckValidSize
void CheckValidSize(std::initializer_list< size_t > validInputCounts, size_t actualValue, const char *validExpr, const char *actualExpr, const CheckLocation &location)
Definition: VerificationHelpers.cpp:16
armnn::CheckLocation
Definition: Exceptions.hpp:14
armnnUtils
Definition: CompatibleTypes.hpp:10
armnnUtils::VerifyInt32
int32_t VerifyInt32(const char *expr, int64_t value, const armnn::CheckLocation &location)
Definition: VerificationHelpers.cpp:52
Exceptions.hpp