From 8d2ca734165a068478df7cffa46185680b05cd20 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 24 Feb 2023 10:28:19 +0000 Subject: Update Doxygen docu for 23.02 Signed-off-by: Nikhil Raj Change-Id: Ie6c19a27d50fefab2796b2b5875374e81f5bf971 --- 23.02/_cl_backend_model_context_8cpp_source.xhtml | 128 ++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 23.02/_cl_backend_model_context_8cpp_source.xhtml (limited to '23.02/_cl_backend_model_context_8cpp_source.xhtml') diff --git a/23.02/_cl_backend_model_context_8cpp_source.xhtml b/23.02/_cl_backend_model_context_8cpp_source.xhtml new file mode 100644 index 0000000000..48616d087b --- /dev/null +++ b/23.02/_cl_backend_model_context_8cpp_source.xhtml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + +ArmNN: src/backends/cl/ClBackendModelContext.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ClBackendModelContext.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 namespace
9 {
10 
11 bool ParseBool(const armnn::BackendOptions::Var& value, bool defaultValue)
12 {
13  if (value.IsBool())
14  {
15  return value.AsBool();
16  }
17  return defaultValue;
18 }
19 
20 std::string ParseFile(const armnn::BackendOptions::Var& value, std::string defaultValue)
21 {
22  if (value.IsString())
23  {
24  return value.AsString();
25  }
26  return defaultValue;
27 }
28 
29 } // namespace anonymous
30 
31 namespace armnn
32 {
33 
35  : m_CachedNetworkFilePath(""), m_IsFastMathEnabled(false), m_SaveCachedNetwork(false), m_CachedFileDescriptor(-1)
36 {
37  if (!modelOptions.empty())
38  {
39  ParseOptions(modelOptions, "GpuAcc", [&](std::string name, const BackendOptions::Var& value)
40  {
41  if (name == "FastMathEnabled")
42  {
43  m_IsFastMathEnabled |= ParseBool(value, false);
44  }
45  if (name == "SaveCachedNetwork")
46  {
47  m_SaveCachedNetwork |= ParseBool(value, false);
48  }
49  if (name == "CachedNetworkFilePath")
50  {
51  m_CachedNetworkFilePath = ParseFile(value, "");
52  }
53  if (name == "CachedFileDescriptor")
54  {
55  m_CachedFileDescriptor = armnn::ParseIntBackendOption(value, -1);
56  }
57  });
58  }
59 }
60 
62 {
63  return m_CachedNetworkFilePath;
64 }
65 
67 {
68  return m_IsFastMathEnabled;
69 }
70 
72 {
73  return m_SaveCachedNetwork;
74 }
75 
77 {
78  return m_CachedFileDescriptor;
79 }
80 
81 } // namespace armnn
Very basic type safe variant.
+
void ParseOptions(const std::vector< BackendOptions > &options, BackendId backend, F f)
+
std::vector< BackendOptions > ModelOptions
+ +
Copyright (c) 2021 ARM Limited and Contributors.
+ +
std::string AsString() const
+ + +
ClBackendModelContext(const ModelOptions &modelOptions)
+
bool AsBool() const
Value getters.
+
bool IsBool() const
Type getters.
+
int ParseIntBackendOption(const armnn::BackendOptions::Var &value, int defaultValue)
+ +
std::string GetCachedNetworkFilePath() const
+
+
+ + + + -- cgit v1.2.1