aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Smirnov <dmitriy.smirnov@arm.com>2024-04-12 14:18:11 +0100
committerDominic Symes <dominic.symes@arm.com>2024-04-18 08:46:20 +0000
commit0306fb6c98178898da6678d1579436da92add171 (patch)
treec13ce0011d59863ef5eed1d7811b71dc99cfcbc1
parent7a53bb3600c2d2063123382c232e4436a788f175 (diff)
downloadreference_model-0306fb6c98178898da6678d1579436da92add171.tar.gz
RFFT2D, refmodel. Correct code when size is one
When width or height are one then H/2 or W/2 are not integral. Signed-off-by: Dmitriy Smirnov <dmitriy.smirnov@arm.com> Change-Id: I1a849bec7cbb1d55fd5f085ebe58be45ea0b508e
-rw-r--r--reference_model/src/ops/tensor_ops.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/reference_model/src/ops/tensor_ops.cc b/reference_model/src/ops/tensor_ops.cc
index afd20e9..edc1793 100644
--- a/reference_model/src/ops/tensor_ops.cc
+++ b/reference_model/src/ops/tensor_ops.cc
@@ -1892,7 +1892,8 @@ int OpRFFT2d<Dtype>::eval()
// Imaginary values with locations (0,0), (0,W/2), (H/2,0) and (H/2,W/2) are zero.
// But due to sin(M_PI) not returning 0 because of M_PI being approximate, only
// add to the imaginary sum when not processing these locations.
- if ((ay % (half_in_height)) + (ax % (half_in_width)) > 0)
+ if ((in_height > 1 && (ay % (half_in_height)) > 0) ||
+ (in_width > 1 && (ax % (half_in_width)) > 0))
{
sum_imag += v_ir * a_sin;
}