ArmNN
 25.11
Loading...
Searching...
No Matches
Utils.hpp
Go to the documentation of this file.
1//
2// Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include <string>
8#include <cmath>
9
10namespace armnn
11{
12
22
23/// Configures the logging behaviour of the ARMNN library.
24/// printToStandardOutput: Set to true if log messages should be printed to the standard output.
25/// printToDebugOutput: Set to true if log messages be printed to a platform-specific debug output
26/// (where supported).
27/// severity: All log messages that are at this severity level or higher will be printed, others will be ignored.
28void ConfigureLogging(bool printToStandardOutput, bool printToDebugOutput, LogSeverity severity);
29
30
31#if defined(__clang__) &&((__clang_major__>=3)||(__clang_major__==3 && __clang_minor__ >= 5))
32# define ARMNN_FALLTHROUGH [[clang::fallthrough]]
33#elif defined(__GNUC__) && (__GNUC__ >= 7)
34# define ARMNN_FALLTHROUGH __attribute__((fallthrough))
35#else
36# define ARMNN_FALLTHROUGH ((void)0)
37#endif
38
39bool NeonDetected();
40
41const std::string GetVersion();
42
43inline float roundf(float value)
44{
45 // Workaround Valgrind's mismatches: when running from Valgrind the call to std::round(4.5) == 4.0 instead of 5.0
46 return (value < 0.f) ? ::floorf(value - 0.5f) : ::floorf(value + 0.5f);
47}
48
49} // namespace armnn
Copyright (c) 2021 ARM Limited and Contributors.
void Debug(const TensorInfo &inputInfo, const T *inputData, LayerGuid guid, const std::string &layerName, unsigned int slotIndex, bool outputsToFile)
Definition Debug.cpp:97
LogSeverity
Definition Utils.hpp:14
const std::string GetVersion()
Definition Utils.cpp:81
void ConfigureLogging(bool printToStandardOutput, bool printToDebugOutput, LogSeverity severity)
Configures the logging behaviour of the ARMNN library.
Definition Utils.cpp:20
float roundf(float value)
Definition Utils.hpp:43
bool NeonDetected()
Definition Utils.cpp:39