MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / Value

Class Value

tests/framework/instruments/Measurement.h:44–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42{
43 /** Measurement value */
44 struct Value
45 {
46 /** Constructor
47 *
48 * @param[in] is_floating Will the value stored be floating point ?
49 */
50 Value(bool is_floating) : v{0}, is_floating_point(is_floating)
51 {
52 }
53
54 /** Add the value stored to the stream as a string
55 */
56 friend std::ostream &operator<<(std::ostream &os, const Value &value)
57 {
58 if (value.is_floating_point)
59 {
60 os << arithmetic_to_string(value.v.floating_point, 4);
61 }
62 else
63 {
64 os << arithmetic_to_string(value.v.integer);
65 }
66 return os;
67 }
68 /** Convert the value stored to string
69 */
70 std::string to_string() const
71 {
72 std::stringstream ss;
73 ss << *this;
74 return ss.str();
75 }
76 /** Add with another value and return the sum
77 *
78 * @param[in] b Other value
79 *
80 * @return Sum of the stored value + b
81 */
82 Value operator+(Value b) const
83 {
84 if (is_floating_point)
85 {
86 b.v.floating_point += v.floating_point;
87 }
88 else
89 {
90 b.v.integer += v.integer;
91 }
92 return b;
93 }
94
95 /** Subtract with another value and return the result
96 *
97 * @param[in] b Other value
98 *
99 * @return Result of the stored value - b
100 */
101 Value operator-(Value b) const

Callers 1

InstrumentsStatsMethod · 0.85

Calls 1

arithmetic_to_stringFunction · 0.85

Tested by

no test coverage detected