Skip to content

Commit

Permalink
CMSIS-DSP: Correction of issue 1169
Browse files Browse the repository at this point in the history
Build issues when building with ARM_MATH_SIZE_MISMATCH defined are corrected.
Improvement to the tests to track ARM_MATH_SIZE_MISMATCH error detection.
  • Loading branch information
christophe0606 committed Apr 13, 2021
1 parent cb9c1e5 commit 6f8bea7
Show file tree
Hide file tree
Showing 25 changed files with 131 additions and 61 deletions.
4 changes: 2 additions & 2 deletions CMSIS/DSP/Include/arm_helium_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ __STATIC_INLINE arm_status arm_mat_cmplx_trans_32bit(
/*
* Set status as ARM_MATH_SIZE_MISMATCH
*/
return = ARM_MATH_SIZE_MISMATCH;
return ARM_MATH_SIZE_MISMATCH;
}
#else
(void)dstRows;
Expand Down Expand Up @@ -535,7 +535,7 @@ __STATIC_INLINE arm_status arm_mat_cmplx_trans_16bit(
/*
* Set status as ARM_MATH_SIZE_MISMATCH
*/
return = ARM_MATH_SIZE_MISMATCH;
return ARM_MATH_SIZE_MISMATCH;
}
#else
(void)dstRows;
Expand Down
3 changes: 3 additions & 0 deletions CMSIS/DSP/Platforms/NORMALFVP/platform.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
function(configure_platform PROJECTNAME ROOT CORE PLATFORMFOLDER)
if (GCC)
target_sources(${PROJECTNAME} PRIVATE ${PLATFORMFOLDER}/${CORE}/Startup/GCC/startup_asm_${CORE}.S)
endif()
endfunction()
6 changes: 2 additions & 4 deletions CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ arm_status arm_mat_ldlt_f32(
if ((pSrc->numRows != pSrc->numCols) ||
(pl->numRows != pl->numCols) ||
(pd->numRows != pd->numCols) ||
(pp->numRows != pp->numCols) ||
(pl->numRows != pl->numRows) )
(pl->numRows != pd->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down Expand Up @@ -380,8 +379,7 @@ arm_status arm_mat_ldlt_f32(
if ((pSrc->numRows != pSrc->numCols) ||
(pl->numRows != pl->numCols) ||
(pd->numRows != pd->numCols) ||
(pp->numRows != pp->numCols) ||
(pl->numRows != pl->numRows) )
(pl->numRows != pd->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down
3 changes: 1 addition & 2 deletions CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ arm_status arm_mat_ldlt_f64(
if ((pSrc->numRows != pSrc->numCols) ||
(pl->numRows != pl->numCols) ||
(pd->numRows != pd->numCols) ||
(pp->numRows != pp->numCols) ||
(pl->numRows != pl->numRows) )
(pl->numRows != pd->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down
2 changes: 1 addition & 1 deletion CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f16.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ arm_status arm_mat_mult_f16(
(pSrcB->numCols != pDst->numCols) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
return(ARM_MATH_SIZE_MISMATCH);
}
else

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
#ifdef ARM_MATH_MATRIX_CHECK

/* Check for matrix mismatch condition */
if ((ut->numRows != lt->numCols) ||
if ((lt->numRows != lt->numCols) ||
(a->numRows != a->numCols) ||
(ut->numRows != a->numRows) )
(lt->numRows != a->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down Expand Up @@ -162,9 +162,9 @@
#ifdef ARM_MATH_MATRIX_CHECK

/* Check for matrix mismatch condition */
if ((ut->numRows != lt->numCols) ||
if ((lt->numRows != lt->numCols) ||
(a->numRows != a->numCols) ||
(ut->numRows != a->numRows) )
(lt->numRows != a->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
#ifdef ARM_MATH_MATRIX_CHECK

/* Check for matrix mismatch condition */
if ((ut->numRows != lt->numCols) ||
if ((lt->numRows != lt->numCols) ||
(a->numRows != a->numCols) ||
(ut->numRows != a->numRows) )
(lt->numRows != a->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down Expand Up @@ -161,9 +161,9 @@
#ifdef ARM_MATH_MATRIX_CHECK

/* Check for matrix mismatch condition */
if ((ut->numRows != lt->numCols) ||
if ((lt->numRows != lt->numCols) ||
(a->numRows != a->numCols) ||
(ut->numRows != a->numRows) )
(lt->numRows != a->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down Expand Up @@ -259,11 +259,10 @@


#ifdef ARM_MATH_MATRIX_CHECK

/* Check for matrix mismatch condition */
if ((ut->numRows != lt->numCols) ||
if ((lt->numRows != lt->numCols) ||
(a->numRows != a->numCols) ||
(ut->numRows != a->numRows) )
(lt->numRows != a->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
#ifdef ARM_MATH_MATRIX_CHECK

/* Check for matrix mismatch condition */
if ((ut->numRows != lt->numCols) ||
if ((lt->numRows != lt->numCols) ||
(a->numRows != a->numCols) ||
(ut->numRows != a->numRows) )
(lt->numRows != a->numRows) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
Expand Down
4 changes: 2 additions & 2 deletions CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q7.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ arm_status arm_mat_trans_q7(const arm_matrix_instance_q7 *pSrc, arm_matrix_insta

#ifdef ARM_MATH_MATRIX_CHECK
/* Check for matrix mismatch condition */
if ((pSrc->numRows != pDst->dstCols) || (pSrc->srcCols != pDst->numCols))
if ((pSrc->numRows != pDst->numCols) || (pSrc->numCols != pDst->numRows))
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
return = ARM_MATH_SIZE_MISMATCH;
return ARM_MATH_SIZE_MISMATCH;
}
#endif

Expand Down
8 changes: 6 additions & 2 deletions CMSIS/DSP/Testing/Source/Tests/BinaryTestsF16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ a double precision computation.
void BinaryTestsF16::test_mat_mult_f16()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -64,7 +65,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_mult_f16(&this->in1,&this->in2,&this->out);
status=arm_mat_mult_f16(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (rows * columns);

Expand All @@ -81,6 +83,7 @@ a double precision computation.
void BinaryTestsF16::test_mat_cmplx_mult_f16()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -90,7 +93,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_cmplx_mult_f16(&this->in1,&this->in2,&this->out);
status=arm_mat_cmplx_mult_f16(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (2*rows * columns);

Expand Down
8 changes: 6 additions & 2 deletions CMSIS/DSP/Testing/Source/Tests/BinaryTestsF32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ a double precision computation.
void BinaryTestsF32::test_mat_mult_f32()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -63,7 +64,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_mult_f32(&this->in1,&this->in2,&this->out);
status=arm_mat_mult_f32(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (rows * columns);

Expand All @@ -82,6 +84,7 @@ a double precision computation.
void BinaryTestsF32::test_mat_cmplx_mult_f32()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -92,7 +95,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_cmplx_mult_f32(&this->in1,&this->in2,&this->out);
status=arm_mat_cmplx_mult_f32(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (2*rows * columns);

Expand Down
4 changes: 3 additions & 1 deletion CMSIS/DSP/Testing/Source/Tests/BinaryTestsF64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ a double precision computation.
void BinaryTestsF64::test_mat_mult_f64()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -63,7 +64,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_mult_f64(&this->in1,&this->in2,&this->out);
status=arm_mat_mult_f64(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (rows * columns);

Expand Down
8 changes: 6 additions & 2 deletions CMSIS/DSP/Testing/Source/Tests/BinaryTestsQ15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ a double precision computation.
void BinaryTestsQ15::test_mat_mult_q15()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -68,7 +69,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_mult_q15(&this->in1,&this->in2,&this->out,tmpPtr);
status=arm_mat_mult_q15(&this->in1,&this->in2,&this->out,tmpPtr);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (rows * columns);

Expand All @@ -88,6 +90,7 @@ a double precision computation.
void BinaryTestsQ15::test_mat_cmplx_mult_q15()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -98,7 +101,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_cmplx_mult_q15(&this->in1,&this->in2,&this->out,tmpPtr);
status=arm_mat_cmplx_mult_q15(&this->in1,&this->in2,&this->out,tmpPtr);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (2*rows * columns);

Expand Down
8 changes: 6 additions & 2 deletions CMSIS/DSP/Testing/Source/Tests/BinaryTestsQ31.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ a double precision computation.
void BinaryTestsQ31::test_mat_mult_q31()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -63,7 +64,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_mult_q31(&this->in1,&this->in2,&this->out);
status=arm_mat_mult_q31(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (rows * columns);

Expand All @@ -82,6 +84,7 @@ a double precision computation.
void BinaryTestsQ31::test_mat_cmplx_mult_q31()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -91,7 +94,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_cmplx_mult_q31(&this->in1,&this->in2,&this->out);
status=arm_mat_cmplx_mult_q31(&this->in1,&this->in2,&this->out);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (2*rows * columns);

Expand Down
4 changes: 3 additions & 1 deletion CMSIS/DSP/Testing/Source/Tests/BinaryTestsQ7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ a double precision computation.
void BinaryTestsQ7::test_mat_mult_q7()
{
LOADDATA2();
arm_status status;

for(i=0;i < nbMatrixes ; i ++)
{
Expand All @@ -65,7 +66,8 @@ a double precision computation.

PREPAREDATA2();

arm_mat_mult_q7(&this->in1,&this->in2,&this->out,tmpPtr);
status=arm_mat_mult_q7(&this->in1,&this->in2,&this->out,tmpPtr);
ASSERT_TRUE(status==ARM_MATH_SUCCESS);

outp += (rows * columns);

Expand Down
2 changes: 2 additions & 0 deletions CMSIS/DSP/Testing/Source/Tests/FIRF32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ static void checkInnerTail(float32_t *b)
#endif
int blockSize;
int numTaps;
#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
int round;
#endif
int nb=0;


Expand Down
2 changes: 1 addition & 1 deletion CMSIS/DSP/Testing/Source/Tests/FIRQ15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ static void checkInnerTail(q15_t *b)
unsigned long i;
#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
int j;
int round;
#endif
int blockSize;
int numTaps;
int round;

/*
Expand Down
2 changes: 1 addition & 1 deletion CMSIS/DSP/Testing/Source/Tests/FIRQ31.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ static void checkInnerTail(q31_t *b)
unsigned long i;
#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
int j;
int round;
#endif
int blockSize;
int numTaps;
int round;
int nb=1;

/*
Expand Down
3 changes: 2 additions & 1 deletion CMSIS/DSP/Testing/Source/Tests/FIRQ7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ static void checkInnerTail(q7_t *b)
unsigned long i;
#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
int j;
int round;
#endif
int blockSize;
int numTaps;
int round;


/*
Expand Down
Loading

0 comments on commit 6f8bea7

Please sign in to comment.