diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2020-09-09 09:07:37 +0100 |
---|---|---|
committer | Jan Eilers <jan.eilers@arm.com> | 2020-09-17 08:31:09 +0000 |
commit | 171214c8ff275c90cd4f7fc23a34ec2c83b5ea39 (patch) | |
tree | 23fd3ee288d631c8c94bede71f89f0f1e12da862 /src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp | |
parent | a25886e0966a6b9433cd23595688fadb88a161b2 (diff) | |
download | armnn-171214c8ff275c90cd4f7fc23a34ec2c83b5ea39.tar.gz |
IVGCVSW-5300 Remove some boost::numeric_cast from armnn/backends
* Replaced with armnn/utility/NumericCast.hpp
* Some exclusions in reference backend
* Excluded as requires float implementation in NumericCast.hpp
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: I9e4e9cd502c865452128fa04415fd6f250baa855
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp')
-rw-r--r-- | src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp index b42b180dc9..2e8e16f0c2 100644 --- a/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/NormalizationTestImpl.cpp @@ -8,6 +8,8 @@ #include <armnn/Exceptions.hpp> #include <armnn/LayerSupport.hpp> +#include <armnn/utility/NumericCast.hpp> + #include <backendsCommon/CpuTensorHandle.hpp> #include <backendsCommon/test/TensorCopyUtils.hpp> @@ -102,7 +104,7 @@ LayerTestResult<float,4> SimpleNormalizationTestImpl( // pow((kappa + (accumulatedScale * alpha)), beta) // ...where accumulatedScale is the sum of every element squared. float divisor[inputNum]; - for(int i = 0; i < boost::numeric_cast<int>(inputNum); i++) + for(int i = 0; i < armnn::numeric_cast<int>(inputNum); i++) { float accumulatedScale = input[i][0][0][0]*input[i][0][0][0] + input[i][0][0][1]*input[i][0][0][1] + @@ -129,11 +131,11 @@ LayerTestResult<float,4> SimpleNormalizationTestImpl( // ...where adjacent channels means within half the normSize for the channel // The test data has only one channel, so this is simplified below. std::vector<float> outputVector; - for (int n = 0; n < boost::numeric_cast<int>(inputNum); ++n) + for (int n = 0; n < armnn::numeric_cast<int>(inputNum); ++n) { - for (int h = 0; h < boost::numeric_cast<int>(inputHeight); ++h) + for (int h = 0; h < armnn::numeric_cast<int>(inputHeight); ++h) { - for (int w = 0; w < boost::numeric_cast<int>(inputWidth); ++w) + for (int w = 0; w < armnn::numeric_cast<int>(inputWidth); ++w) { float accumulatedScale = input[n][0][h][w]*input[n][0][h][w]; float scale = powf((kappa + accumulatedScale * alpha), -beta); |