aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLPermuteKernel.cpp
diff options
context:
space:
mode:
authorDiego Lopez Recas <Diego.LopezRecas@arm.com>2018-02-22 16:10:17 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:47:40 +0000
commit3db5eef2f97b57b01048353055aba9c29bbd72c4 (patch)
tree390763bd1a3b31fbd9433e509fb707fb9f3fe468 /src/core/CL/kernels/CLPermuteKernel.cpp
parent3502613ec7223a415c6f648d8e0b54d387e00d7d (diff)
downloadComputeLibrary-3db5eef2f97b57b01048353055aba9c29bbd72c4.tar.gz
IVGCVSW-972 Fix CL Permute validation
Change-Id: Ifd8e7ea445792a0ece1955bc2bc3454e75006dc8 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121930 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLPermuteKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLPermuteKernel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/CL/kernels/CLPermuteKernel.cpp b/src/core/CL/kernels/CLPermuteKernel.cpp
index 12c2d58ef6..da34448c02 100644
--- a/src/core/CL/kernels/CLPermuteKernel.cpp
+++ b/src/core/CL/kernels/CLPermuteKernel.cpp
@@ -54,10 +54,10 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c
DataType::U16, DataType::S16, DataType::QS16,
DataType::U32, DataType::S32,
DataType::F16, DataType::F32);
- ARM_COMPUTE_RETURN_ERROR_ON_MSG((input->num_dimensions() < 3), "Invalid input size!");
- ARM_COMPUTE_RETURN_ERROR_ON_MSG(((perm.num_dimensions() == 3 && !(perm[0] == 2 && perm[1] == 0 && perm[2] == 1) && !(perm[0] == 1 && perm[1] == 2 && perm[2] == 0)) || (perm.num_dimensions() == 4
- && !(perm[0] == 3 && perm[1] == 2 && perm[2] == 0 && perm[3] == 1))),
- "Only [2, 0, 1],[1, 2, 0] and [3, 2, 0, 1] permutation is supported");
+ ARM_COMPUTE_RETURN_ERROR_ON_MSG((perm != PermutationVector{ 2U, 0U, 1U })
+ && (perm != PermutationVector{ 1U, 2U, 0U })
+ && (perm != PermutationVector{ 3U, 2U, 0U, 1U }),
+ "Only [2, 0, 1], [1, 2, 0] and [3, 2, 0, 1] permutation is supported");
const TensorShape output_shape = misc::shape_calculator::compute_permutation_output_shape(*input, perm);