From: Shubham Gupta/System SW /SRI-Bangalore/Engineer/삼성전자 Date: Fri, 26 Oct 2018 08:26:16 +0000 (+0530) Subject: Correcting and adding arm_compute assertions in CL core/kernel files (#3312) X-Git-Tag: 0.3~517 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1bda68db7eec2f5bc19b6d0b6b1733ecca778c45;p=platform%2Fcore%2Fml%2Fnnfw.git Correcting and adding arm_compute assertions in CL core/kernel files (#3312) This patch will add more asertions required to be tested and corrects the wrong assertions that have been added. Signed-off-by: shubham --- diff --git a/libs/ARMComputeEx/src/core/CL/kernels/CLBatchToSpaceNDKernel.cpp b/libs/ARMComputeEx/src/core/CL/kernels/CLBatchToSpaceNDKernel.cpp index f8d7248..2ed4dc4 100644 --- a/libs/ARMComputeEx/src/core/CL/kernels/CLBatchToSpaceNDKernel.cpp +++ b/libs/ARMComputeEx/src/core/CL/kernels/CLBatchToSpaceNDKernel.cpp @@ -52,9 +52,16 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, output->dimension(3) * block_size[0] * block_size[1] == input->dimension(3), "Input batch should be equal to (output batch * block size[0] *block size[1])"); - ARM_COMPUTE_RETURN_ERROR_ON_MSG(!(input->dimension(0) % block_size[1]) && - !(input->dimension(1) % block_size[0]), - "Input height and width should be divisible by block size"); + ARM_COMPUTE_RETURN_ERROR_ON_MSG(!(output->dimension(0) % block_size[1]) && + !(output->dimension(1) % block_size[0]), + "Output height and width should be divisible by block size[0] " + "and block_size[1] respectively"); + + ARM_COMPUTE_RETURN_ERROR_ON_MSG((output->dimension(0) == input->dimension(0) * block_size[1]) && + (output->dimension(1) == input->dimension(1) * block_size[0]), + "Output height and width should be equal to " + "input_height*blocksize[0] and input_width*blocksize[1] " + "respectively"); return Status{}; } diff --git a/libs/ARMComputeEx/src/core/CL/kernels/CLSpaceToDepthKernel.cpp b/libs/ARMComputeEx/src/core/CL/kernels/CLSpaceToDepthKernel.cpp index dd23078..871b559 100644 --- a/libs/ARMComputeEx/src/core/CL/kernels/CLSpaceToDepthKernel.cpp +++ b/libs/ARMComputeEx/src/core/CL/kernels/CLSpaceToDepthKernel.cpp @@ -56,6 +56,11 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, !(input->dimension(1) % block_size), "Input height and width should be divisible by block size"); + ARM_COMPUTE_RETURN_ERROR_ON_MSG((output->dimension(0) == (input->dimension(0) / block_size)) && + (output->dimension(1) == (input->dimension(1) / block_size)), + "Output height and width should be equal to " + "input_height/blocksize and input_width/blocksize respectively"); + return Status{}; }