From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_profiling_state_machine_8cpp_source.xhtml | 127 +++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 20.02/_profiling_state_machine_8cpp_source.xhtml (limited to '20.02/_profiling_state_machine_8cpp_source.xhtml') diff --git a/20.02/_profiling_state_machine_8cpp_source.xhtml b/20.02/_profiling_state_machine_8cpp_source.xhtml new file mode 100644 index 0000000000..2fd76db6e5 --- /dev/null +++ b/20.02/_profiling_state_machine_8cpp_source.xhtml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + +ArmNN: src/profiling/ProfilingStateMachine.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ProfilingStateMachine.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 
8 #include <armnn/Exceptions.hpp>
9 
10 #include <sstream>
11 
12 namespace armnn
13 {
14 
15 namespace profiling
16 {
17 
18 namespace
19 {
20 
21 void ThrowStateTransitionException(ProfilingState expectedState, ProfilingState newState)
22 {
23  std::stringstream ss;
24  ss << "Cannot transition from state [" << GetProfilingStateName(expectedState) << "] "
25  << "to state [" << GetProfilingStateName(newState) << "]";
26  throw armnn::RuntimeException(ss.str());
27 }
28 
29 } // Anonymous namespace
30 
32 {
33  return m_State.load();
34 }
35 
37 {
38  ProfilingState currentState = m_State.load(std::memory_order::memory_order_relaxed);
39 
40  switch (newState)
41  {
43  do
44  {
45  if (!IsOneOfStates(currentState, ProfilingState::Uninitialised))
46  {
47  ThrowStateTransitionException(currentState, newState);
48  }
49  }
50  while (!m_State.compare_exchange_strong(currentState, newState, std::memory_order::memory_order_relaxed));
51  break;
53  do
54  {
57  {
58  ThrowStateTransitionException(currentState, newState);
59  }
60  }
61  while (!m_State.compare_exchange_strong(currentState, newState, std::memory_order::memory_order_relaxed));
62  break;
64  do
65  {
67  {
68  ThrowStateTransitionException(currentState, newState);
69  }
70  }
71  while (!m_State.compare_exchange_strong(currentState, newState, std::memory_order::memory_order_relaxed));
72  break;
74  do
75  {
77  {
78  ThrowStateTransitionException(currentState, newState);
79  }
80  }
81  while (!m_State.compare_exchange_strong(currentState, newState, std::memory_order::memory_order_relaxed));
82  break;
83  default:
84  break;
85  }
86 }
87 
89 {
90  m_State.store(ProfilingState::Uninitialised);
91 }
92 
93 } // namespace profiling
94 
95 } // namespace armnn
+ +
Copyright (c) 2020 ARM Limited.
+ + + + + + + + + +
void TransitionToState(ProfilingState newState)
+
constexpr char const * GetProfilingStateName(ProfilingState state)
+
+
+ + + + -- cgit v1.2.1