diff options
Diffstat (limited to 'src/armnnUtils/PrototxtConversions.cpp')
-rw-r--r-- | src/armnnUtils/PrototxtConversions.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/armnnUtils/PrototxtConversions.cpp b/src/armnnUtils/PrototxtConversions.cpp new file mode 100644 index 0000000000..1a6c053355 --- /dev/null +++ b/src/armnnUtils/PrototxtConversions.cpp @@ -0,0 +1,32 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "PrototxtConversions.hpp" + +#include <boost/format.hpp> + +#include <iomanip> +#include <sstream> +#include <string> + +namespace armnnUtils +{ + +/// Converts an int value into the Prototxt octal representation +std::string ConvertInt32ToOctalString(int value) +{ + std::stringstream ss; + std::string returnString; + for (int i = 0; i < 4; ++i) + { + ss << "\\"; + ss << std::setw(3) << std::setfill('0') << std::oct << ((value >> (i * 8)) & 0xFF); + } + + ss >> returnString; + return returnString; +} + +} // namespace armnnUtils |