diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-04 18:01:21 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-07 11:25:42 +0000 |
commit | d5b9e6497b03d58c671c15b9ebe8e35500171f06 (patch) | |
tree | bf1e995d1b88f75cf497e8fd5f52f5003272187e /src/armnnUtils/Permute.cpp | |
parent | 2ad6cb486164ff3aabe4e9ecabc47f08da48da35 (diff) | |
download | armnn-d5b9e6497b03d58c671c15b9ebe8e35500171f06.tar.gz |
IVGCVSW-2421 Remove the template-based version of armnnUtils::Permute
in favor of a type-indepent implementation that takes void-pointers
* The new implementation requires the size of the type to be passed
to the function
* Updated all the usages accordingly
* Removed the old implementation no longer used
!android-nn-driver:469
Change-Id: I37f4e6d62a38fbb8ec8c39bb559a2c54c83365d4
Diffstat (limited to 'src/armnnUtils/Permute.cpp')
-rw-r--r-- | src/armnnUtils/Permute.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/armnnUtils/Permute.cpp b/src/armnnUtils/Permute.cpp index 6deff90168..24a8286bba 100644 --- a/src/armnnUtils/Permute.cpp +++ b/src/armnnUtils/Permute.cpp @@ -39,14 +39,6 @@ public: } } - template <typename T> - void Unroll(const T* srcData, T* dstData) - { - const T* const srcEnd = srcData + m_DstShape.GetNumElements(); - T* const dstEnd = dstData + m_DstShape.GetNumElements(); - Unroll(0, srcData, dstData, srcEnd, dstEnd); - } - void Unroll(const void* srcData, void* dstData, size_t dataTypeSize) { assert(srcData); @@ -63,32 +55,6 @@ public: } private: - template <typename T> - void Unroll(size_type dimension, const T* srcData, T* dstData, const T* srcEnd, T* dstEnd) - { - assert(srcData); - assert(dstData); - assert(srcEnd); - assert(dstEnd); - assert(srcData < srcEnd); - assert(dstData < dstEnd); - - if (dimension >= m_DstShape.GetNumDimensions()) - { - *dstData = *srcData; - } - else - { - for (size_type i = 0; i < m_DstShape[dimension]; i++) - { - Unroll(dimension + 1, srcData, dstData, srcEnd, dstEnd); - - srcData += m_SrcStrides[dimension]; - dstData += m_DstStrides[dimension]; - } - } - } - void Unroll(size_type dimension, const unsigned char* srcData, unsigned char* dstData, const unsigned char* srcEnd, unsigned char* dstEnd, @@ -157,22 +123,4 @@ void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& PermuteLoop(dstShape, mappings).Unroll(src, dst, dataTypeSize); } -template <typename T> -void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& mappings, const T* src, T* dst) -{ - PermuteLoop(dstShape, mappings).Unroll(src, dst); -} - -// 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); -template void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& mappings, - const int32_t* src, int32_t* dst); -template void Permute(const armnn::TensorShape& dstShape, const armnn::PermutationVector& mappings, - const bool* src, bool* dst); - } // namespace armnnUtils |