tests: lib: cmsis_dsp: matrix: Update Binary F32 tests for 1.9.0

This commit updates the matrix Binary F32 test patterns and
implementations for the CMSIS-DSP 1.9.0.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2021-08-20 22:09:27 +09:00 committed by Carles Cufí
commit 518589efb4
2 changed files with 8712 additions and 7784 deletions

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2020 Stephanos Ioannidis <root@stephanos.io> * Copyright (c) 2021 Stephanos Ioannidis <root@stephanos.io>
* Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -30,6 +30,7 @@ static void test_op2(int op, const uint32_t *input1, const uint32_t *input2,
uint16_t *dims = (uint16_t *)in_dims; uint16_t *dims = (uint16_t *)in_dims;
float32_t *tmp1, *tmp2, *output; float32_t *tmp1, *tmp2, *output;
uint16_t rows, internal, columns; uint16_t rows, internal, columns;
arm_status status;
arm_matrix_instance_f32 mat_in1; arm_matrix_instance_f32 mat_in1;
arm_matrix_instance_f32 mat_in2; arm_matrix_instance_f32 mat_in2;
@ -76,12 +77,17 @@ static void test_op2(int op, const uint32_t *input1, const uint32_t *input2,
/* Run test function */ /* Run test function */
switch (op) { switch (op) {
case OP2_MULT: case OP2_MULT:
arm_mat_mult_f32(&mat_in1, &mat_in2, &mat_out); status = arm_mat_mult_f32(&mat_in1, &mat_in2,
&mat_out);
break; break;
default: default:
zassert_unreachable("invalid operation"); zassert_unreachable("invalid operation");
} }
/* Validate status */
zassert_equal(status, ARM_MATH_SUCCESS,
ASSERT_MSG_INCORRECT_COMP_RESULT);
/* Increment output pointer */ /* Increment output pointer */
mat_out.pData += (rows * columns); mat_out.pData += (rows * columns);
} }
@ -115,6 +121,7 @@ static void test_op2c(int op, const uint32_t *input1, const uint32_t *input2,
uint16_t *dims = (uint16_t *)in_dims; uint16_t *dims = (uint16_t *)in_dims;
float32_t *tmp1, *tmp2, *output; float32_t *tmp1, *tmp2, *output;
uint16_t rows, internal, columns; uint16_t rows, internal, columns;
arm_status status;
arm_matrix_instance_f32 mat_in1; arm_matrix_instance_f32 mat_in1;
arm_matrix_instance_f32 mat_in2; arm_matrix_instance_f32 mat_in2;
@ -161,12 +168,17 @@ static void test_op2c(int op, const uint32_t *input1, const uint32_t *input2,
/* Run test function */ /* Run test function */
switch (op) { switch (op) {
case OP2C_CMPLX_MULT: case OP2C_CMPLX_MULT:
arm_mat_cmplx_mult_f32(&mat_in1, &mat_in2, &mat_out); status = arm_mat_cmplx_mult_f32(&mat_in1, &mat_in2,
&mat_out);
break; break;
default: default:
zassert_unreachable("invalid operation"); zassert_unreachable("invalid operation");
} }
/* Validate status */
zassert_equal(status, ARM_MATH_SUCCESS,
ASSERT_MSG_INCORRECT_COMP_RESULT);
/* Increment output pointer */ /* Increment output pointer */
mat_out.pData += (2 * rows * columns); mat_out.pData += (2 * rows * columns);
} }

File diff suppressed because it is too large Load diff