Skip to content

Commit 09bda62

Browse files
committed
fix: compiler error in TopKV
Change-Id: I8b7802a738174ea4d8ba8917b56f79799d53046c Signed-off-by: Pablo Marquez Tello <pablo.tello@arm.com>
1 parent d1fe74d commit 09bda62

File tree

1 file changed

+2
-3
lines changed
  • src/cpu/kernels/topkv/generic/sve

1 file changed

+2
-3
lines changed

src/cpu/kernels/topkv/generic/sve/impl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ topkv_sve_wrapper(const ITensor *predictions, const ITensor *targets, ITensor *o
8585

8686
const ITensorInfo *pred_info = predictions->info();
8787
const uint32_t N = pred_info->dimension(0); // samples
88-
const uint32_t C = pred_info->dimension(1); // classes
8988

9089
const uint32_t vl = vector_length<Scalar>(); // cache once per kernel invocation
9190

@@ -96,8 +95,8 @@ topkv_sve_wrapper(const ITensor *predictions, const ITensor *targets, ITensor *o
9695
window,
9796
[&](const Coordinates &id)
9897
{
99-
const uint32_t c = static_cast<uint32_t>(id.x()); // class index
100-
ARM_COMPUTE_ERROR_ON(c >= C);
98+
const uint32_t c = static_cast<uint32_t>(id.x()); // class index
99+
ARM_COMPUTE_ERROR_ON(c >= pred_info->dimension(1)); // classes
101100

102101
uint32_t t = {*reinterpret_cast<uint32_t *>(tgt_it.ptr())};
103102
ARM_COMPUTE_ERROR_ON(t >= N);

0 commit comments

Comments
 (0)