aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnUtils')
-rw-r--r--src/armnnUtils/FloatingPointConverter.cpp3
-rw-r--r--src/armnnUtils/Half.hpp35
-rw-r--r--src/armnnUtils/Permute.cpp3
3 files changed, 40 insertions, 1 deletions
diff --git a/src/armnnUtils/FloatingPointConverter.cpp b/src/armnnUtils/FloatingPointConverter.cpp
index 522c44b093..92409d4eea 100644
--- a/src/armnnUtils/FloatingPointConverter.cpp
+++ b/src/armnnUtils/FloatingPointConverter.cpp
@@ -4,7 +4,8 @@
//
#include "FloatingPointConverter.hpp"
-#include "../armnn/Half.hpp"
+
+#include "Half.hpp"
#include <boost/assert.hpp>
diff --git a/src/armnnUtils/Half.hpp b/src/armnnUtils/Half.hpp
new file mode 100644
index 0000000000..c4b47a3609
--- /dev/null
+++ b/src/armnnUtils/Half.hpp
@@ -0,0 +1,35 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include <type_traits>
+#include <half/half.hpp>
+
+namespace armnn
+{
+ using Half = half_float::half; //import half float implementation
+} //namespace armnn
+
+
+namespace std
+{
+
+template<>
+struct is_floating_point<armnn::Half>
+ : integral_constant< bool, true >
+{};
+
+template<>
+struct is_floating_point<const armnn::Half>
+ : integral_constant< bool, true >
+{};
+
+template<>
+struct is_floating_point<volatile armnn::Half>
+ : integral_constant< bool, true >
+{};
+
+} //namespace std \ No newline at end of file
diff --git a/src/armnnUtils/Permute.cpp b/src/armnnUtils/Permute.cpp
index 9fe198b3a7..61f4e0e644 100644
--- a/src/armnnUtils/Permute.cpp
+++ b/src/armnnUtils/Permute.cpp
@@ -5,6 +5,7 @@
#include "Permute.hpp"
+#include "Half.hpp"
#include <armnn/Tensor.hpp>
#include <cassert>
@@ -109,6 +110,8 @@ void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector&
// Instantiates for types.
template void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& mappings,
+ const armnn::Half* src, armnn::Half* dst);
+template void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& mappings,
const float* src, float* dst);
template void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& mappings,
const uint8_t* src, uint8_t* dst);