From f86be93b7492b381370cae7bf71eca8572a0cbae Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Tue, 24 Aug 2021 16:27:15 +0100 Subject: IVGCVSW-5924 Update 21.08 Doxygen Documents * Also updated latest symlink. Signed-off-by: Matthew Sloyan Change-Id: If9b4e0e52464abdf797b9eb858ae19bcc64c2aea --- 21.08/_verification_helpers_8cpp_source.xhtml | 123 ++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 21.08/_verification_helpers_8cpp_source.xhtml (limited to '21.08/_verification_helpers_8cpp_source.xhtml') diff --git a/21.08/_verification_helpers_8cpp_source.xhtml b/21.08/_verification_helpers_8cpp_source.xhtml new file mode 100644 index 0000000000..18477ba229 --- /dev/null +++ b/21.08/_verification_helpers_8cpp_source.xhtml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + +ArmNN: src/armnnUtils/VerificationHelpers.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
VerificationHelpers.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include <armnn/Exceptions.hpp>
8 
9 #include <fmt/format.h>
10 
11 using namespace armnn;
12 
13 namespace armnnUtils
14 {
15 
16 void CheckValidSize(std::initializer_list<size_t> validInputCounts,
17  size_t actualValue,
18  const char* validExpr,
19  const char* actualExpr,
20  const CheckLocation& location)
21 {
22  bool isValid = std::any_of(validInputCounts.begin(),
23  validInputCounts.end(),
24  [&actualValue](size_t x) { return x == actualValue; } );
25  if (!isValid)
26  {
27  throw ParseException(fmt::format("{} = {} is not valid, not in {{}}. {}",
28  actualExpr,
29  actualValue,
30  validExpr,
31  location.AsString()));
32  }
33 }
34 
35 uint32_t NonNegative(const char* expr,
36  int32_t value,
37  const CheckLocation& location)
38 {
39  if (value < 0)
40  {
41  throw ParseException(fmt::format("'{}' must be non-negative, received: {} at {}",
42  expr,
43  value,
44  location.AsString()));
45  }
46  else
47  {
48  return static_cast<uint32_t>(value);
49  }
50 }
51 
52 int32_t VerifyInt32(const char* expr,
53  int64_t value,
54  const armnn::CheckLocation& location)
55 {
56  if (value < std::numeric_limits<int>::min() || value > std::numeric_limits<int>::max())
57  {
58  throw ParseException(fmt::format("'{}' must should fit into a int32 (ArmNN don't support int64),"
59  " received: {} at {}",
60  expr,
61  value,
62  location.AsString()));
63  }
64  else
65  {
66  return static_cast<int32_t>(value);
67  }
68 }
69 
70 }// armnnUtils
void CheckValidSize(std::initializer_list< size_t > validInputCounts, size_t actualValue, const char *validExpr, const char *actualExpr, const CheckLocation &location)
+
std::string AsString() const
Definition: Exceptions.hpp:29
+
Copyright (c) 2021 ARM Limited and Contributors.
+ + +
uint32_t NonNegative(const char *expr, int32_t value, const CheckLocation &location)
+ + +
int32_t VerifyInt32(const char *expr, int64_t value, const armnn::CheckLocation &location)
+ +
+
+ + + + -- cgit v1.2.1