aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/cl_kernels/nhwc/batch_to_space.cl
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2024-01-16 16:23:24 +0000
committerViet-Hoa Do <viet-hoa.do@arm.com>2024-01-18 11:32:09 +0000
commit6829e0201e886cfd311e39f1d88f7452894bdfe5 (patch)
treeac1b97df4b76d0d09652ef3dbdce2be3d222df3c /src/core/CL/cl_kernels/nhwc/batch_to_space.cl
parent8896cf7cb7df34c699e7453a0f0c683d1202ed15 (diff)
downloadComputeLibrary-6829e0201e886cfd311e39f1d88f7452894bdfe5.tar.gz
Fix divide-by-zero compilation error
* CONVERT_TO_TENSOR4D_STRUCT_NO_STEP is implemented and used in some CL kernels in the way that causes divide-by-zero issue. - Since the steps are all zeros, the issue might have been ignored by the compiler. Resolves: COMPMID-6795 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I0fb38fc62d63671b8abefa39b3d9b3ca6f49c7fe Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10967 Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/cl_kernels/nhwc/batch_to_space.cl')
-rw-r--r--src/core/CL/cl_kernels/nhwc/batch_to_space.cl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/CL/cl_kernels/nhwc/batch_to_space.cl b/src/core/CL/cl_kernels/nhwc/batch_to_space.cl
index 16141bcd2e..b910a753a6 100644
--- a/src/core/CL/cl_kernels/nhwc/batch_to_space.cl
+++ b/src/core/CL/cl_kernels/nhwc/batch_to_space.cl
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2021, 2023 Arm Limited.
+ * Copyright (c) 2018-2021, 2023-2024 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -63,7 +63,7 @@ __kernel void batch_to_space_nhwc(
TENSOR3D_DECLARATION(output))
{
Tensor3D out = CONVERT_TO_TENSOR3D_STRUCT(output);
- Tensor4D in = CONVERT_TO_TENSOR4D_STRUCT_NO_STEP(input, 0);
+ Tensor4D in = CONVERT_TO_TENSOR4D_STRUCT_NO_STEP(input);
Vector block = CONVERT_TO_VECTOR_STRUCT_NO_STEP(block_shape);
const int block_x = *((__global int *)vector_offset(&block, 0));
@@ -113,7 +113,7 @@ __kernel void batch_to_space_static_nhwc(
TENSOR3D_DECLARATION(output))
{
Tensor3D out = CONVERT_TO_TENSOR3D_STRUCT(output);
- Tensor4D in = CONVERT_TO_TENSOR4D_STRUCT_NO_STEP(input, 0);
+ Tensor4D in = CONVERT_TO_TENSOR4D_STRUCT_NO_STEP(input);
const int block_x = BLOCK_SHAPE_X;
const int block_y = BLOCK_SHAPE_Y;
@@ -128,4 +128,4 @@ __kernel void batch_to_space_static_nhwc(
*((__global DATA_TYPE *)out.ptr) = *((__global DATA_TYPE *)tensor4D_offset(&in, z, in_x, in_y, in_batch));
}
-#endif // defined(DATA_TYPE) && defined(BATCH_SIZE) && defined(BLOCK_SHAPE_X) && defined(BLOCK_SHAPE_Y) \ No newline at end of file
+#endif // defined(DATA_TYPE) && defined(BATCH_SIZE) && defined(BLOCK_SHAPE_X) && defined(BLOCK_SHAPE_Y)