Skip to content

Commit

Permalink
Corrected issue #99 : name conflicts with Zephyr
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe0606 committed Oct 25, 2023
1 parent d2086f9 commit 00bab39
Show file tree
Hide file tree
Showing 24 changed files with 54 additions and 54 deletions.
9 changes: 6 additions & 3 deletions Include/dsp/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ extern "C"
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#endif

#define SQ(x) ((x) * (x))
#ifndef ARM_SQ
#define ARM_SQ(x) ((x) * (x))
#endif

#ifndef ROUND_UP
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
#ifndef ARM_ROUND_UP
#define ARM_ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
#endif


Expand Down Expand Up @@ -251,6 +253,7 @@ __STATIC_INLINE int32_t arm_div_int64_to_int32(int64_t num, int32_t den)
return result;
}

#undef INDEX_MASK

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion Source/DistanceFunctions/arm_euclidean_distance_f16.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ float16_t arm_euclidean_distance_f16(const float16_t *pA,const float16_t *pB, ui
while(blockSize > 0)
{
tmp = (_Float16)*pA++ - (_Float16)*pB++;
accum += SQ(tmp);
accum += ARM_SQ(tmp);
blockSize --;
}
arm_sqrt_f16(accum,&result);
Expand Down
4 changes: 2 additions & 2 deletions Source/DistanceFunctions/arm_euclidean_distance_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ float32_t arm_euclidean_distance_f32(const float32_t *pA,const float32_t *pB, ui
while(blkCnt > 0)
{
tmp = *pA++ - *pB++;
accum += SQ(tmp);
accum += ARM_SQ(tmp);
blkCnt --;
}
arm_sqrt_f32(accum,&tmp);
Expand All @@ -137,7 +137,7 @@ float32_t arm_euclidean_distance_f32(const float32_t *pA,const float32_t *pB, ui
while(blockSize > 0)
{
tmp = *pA++ - *pB++;
accum += SQ(tmp);
accum += ARM_SQ(tmp);
blockSize --;
}
arm_sqrt_f32(accum,&tmp);
Expand Down
2 changes: 1 addition & 1 deletion Source/DistanceFunctions/arm_euclidean_distance_f64.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ float64_t arm_euclidean_distance_f64(const float64_t *pA,const float64_t *pB, ui
while(blkCnt > 0)
{
tmp = *pA++ - *pB++;
accum += SQ(tmp);
accum += ARM_SQ(tmp);
blkCnt --;
}
tmp = sqrt(accum);
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_fir_f16.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void arm_fir_f16(const arm_fir_instance_f16 * S,
float16_t * pDst,
uint32_t blockSize)
{
float16_t *pRefStatePtr = S->pState + ROUND_UP(blockSize, 8);
float16_t *pRefStatePtr = S->pState + ARM_ROUND_UP(blockSize, 8);
float16_t *pState = pRefStatePtr ; /* State pointer */
const float16_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
const float16_t *pSamples; /* Temporary pointer to the sample buffer */
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_fir_init_f16.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void arm_fir_init_f16(

/* Clear state buffer. The size is always (blockSize + numTaps - 1) */
#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE)
memset(pState, 0, (numTaps + (blockSize - 1U) + ROUND_UP(blockSize, 8)) * sizeof(float16_t));
memset(pState, 0, (numTaps + (blockSize - 1U) + ARM_ROUND_UP(blockSize, 8)) * sizeof(float16_t));
#else
memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(float16_t));
#endif
Expand Down
2 changes: 1 addition & 1 deletion Source/FilteringFunctions/arm_fir_init_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void arm_fir_init_q31(

/* Clear state buffer. The size is always (blockSize + numTaps - 1) */
#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
memset(pState, 0, (numTaps + (blockSize - 1U) + 2*ROUND_UP(blockSize, 4)) * sizeof(q31_t));
memset(pState, 0, (numTaps + (blockSize - 1U) + 2*ARM_ROUND_UP(blockSize, 4)) * sizeof(q31_t));
#else
memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q31_t));
#endif
Expand Down
8 changes: 4 additions & 4 deletions Source/FilteringFunctions/arm_fir_q31.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

#define FIR_Q31_MAIN_CORE() \
{ \
q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4); \
q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4); \
q31_t *pState = pRefStatePtr; /* State pointer */ \
const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ \
q31_t *pStateCur; /* Points to the current sample of the state */ \
Expand Down Expand Up @@ -210,7 +210,7 @@ static void arm_fir_q31_1_4_mve(const arm_fir_instance_q31 * S,
const q31_t * __restrict pSrc,
q31_t * __restrict pDst, uint32_t blockSize)
{
q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);
q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4);
q31_t *pState = pRefStatePtr; /* State pointer */
const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
q31_t *pStateCur; /* Points to the current sample of the state */
Expand Down Expand Up @@ -452,7 +452,7 @@ static void arm_fir_q31_29_32_mve(const arm_fir_instance_q31 * S,
q31_t * __restrict pDst,
uint32_t blockSize)
{
q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);
q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4);
q31_t *pState = pRefStatePtr; /* State pointer */
const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
q31_t *pStateCur; /* Points to the current sample of the state */
Expand Down Expand Up @@ -652,7 +652,7 @@ void arm_fir_q31(
q31_t * pDst,
uint32_t blockSize)
{
q31_t *pRefStatePtr = S->pState + 2*ROUND_UP(blockSize, 4);
q31_t *pRefStatePtr = S->pState + 2*ARM_ROUND_UP(blockSize, 4);
q31_t *pState = pRefStatePtr; /* State pointer */
const q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */
q31_t *pStateCur; /* Points to the current sample of the state */
Expand Down
8 changes: 4 additions & 4 deletions Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ void arm_quaternion2rotation_f32(const float32_t *pInputQuaternions,
uint32_t nb;
for(nb=0; nb < nbQuaternions; nb++)
{
float32_t q00 = SQ(pInputQuaternions[0 + nb * 4]);
float32_t q11 = SQ(pInputQuaternions[1 + nb * 4]);
float32_t q22 = SQ(pInputQuaternions[2 + nb * 4]);
float32_t q33 = SQ(pInputQuaternions[3 + nb * 4]);
float32_t q00 = ARM_SQ(pInputQuaternions[0 + nb * 4]);
float32_t q11 = ARM_SQ(pInputQuaternions[1 + nb * 4]);
float32_t q22 = ARM_SQ(pInputQuaternions[2 + nb * 4]);
float32_t q33 = ARM_SQ(pInputQuaternions[3 + nb * 4]);
float32_t q01 = pInputQuaternions[0 + nb * 4]*pInputQuaternions[1 + nb * 4];
float32_t q02 = pInputQuaternions[0 + nb * 4]*pInputQuaternions[2 + nb * 4];
float32_t q03 = pInputQuaternions[0 + nb * 4]*pInputQuaternions[3 + nb * 4];
Expand Down
8 changes: 4 additions & 4 deletions Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ void arm_quaternion_inverse_f32(const float32_t *pInputQuaternions,
for(i=0; i < nbQuaternions; i++)
{

temp = SQ(pInputQuaternions[4 * i + 0]) +
SQ(pInputQuaternions[4 * i + 1]) +
SQ(pInputQuaternions[4 * i + 2]) +
SQ(pInputQuaternions[4 * i + 3]);
temp = ARM_SQ(pInputQuaternions[4 * i + 0]) +
ARM_SQ(pInputQuaternions[4 * i + 1]) +
ARM_SQ(pInputQuaternions[4 * i + 2]) +
ARM_SQ(pInputQuaternions[4 * i + 3]);

pInverseQuaternions[4 * i + 0] = pInputQuaternions[4 * i + 0] / temp;
pInverseQuaternions[4 * i + 1] = -pInputQuaternions[4 * i + 1] / temp;
Expand Down
8 changes: 4 additions & 4 deletions Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ void arm_quaternion_norm_f32(const float32_t *pInputQuaternions,

for(i=0; i < nbQuaternions; i++)
{
temp = SQ(pInputQuaternions[4 * i + 0]) +
SQ(pInputQuaternions[4 * i + 1]) +
SQ(pInputQuaternions[4 * i + 2]) +
SQ(pInputQuaternions[4 * i + 3]);
temp = ARM_SQ(pInputQuaternions[4 * i + 0]) +
ARM_SQ(pInputQuaternions[4 * i + 1]) +
ARM_SQ(pInputQuaternions[4 * i + 2]) +
ARM_SQ(pInputQuaternions[4 * i + 3]);
pNorms[i] = sqrtf(temp);
}
}
Expand Down
8 changes: 4 additions & 4 deletions Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ void arm_quaternion_normalize_f32(const float32_t *pInputQuaternions,
uint32_t i;
for(i=0; i < nbQuaternions; i++)
{
temp = SQ(pInputQuaternions[4 * i + 0]) +
SQ(pInputQuaternions[4 * i + 1]) +
SQ(pInputQuaternions[4 * i + 2]) +
SQ(pInputQuaternions[4 * i + 3]);
temp = ARM_SQ(pInputQuaternions[4 * i + 0]) +
ARM_SQ(pInputQuaternions[4 * i + 1]) +
ARM_SQ(pInputQuaternions[4 * i + 2]) +
ARM_SQ(pInputQuaternions[4 * i + 3]);
temp = sqrtf(temp);

pNormalizedQuaternions[4 * i + 0] = pInputQuaternions[4 * i + 0] / temp;
Expand Down
2 changes: 1 addition & 1 deletion Source/SVMFunctions/arm_svm_rbf_predict_f16.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void arm_svm_rbf_predict_f16(
dot=0.0f16;
for(j=0; j < S->vectorDimension; j++)
{
dot = dot + SQ((_Float16)in[j] - (_Float16) *pSupport);
dot = dot + ARM_SQ((_Float16)in[j] - (_Float16) *pSupport);
pSupport++;
}
sum += (_Float16)S->dualCoefficients[i] * (_Float16)expf((float32_t)(-(_Float16)S->gamma * (_Float16)dot));
Expand Down
12 changes: 6 additions & 6 deletions Source/SVMFunctions/arm_svm_rbf_predict_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ void arm_svm_rbf_predict_f32(
blkCnt = S->vectorDimension & 3;
while (blkCnt > 0U)
{
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,0) + SQ(*pIn - *pSupporta), dotV,0);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,1) + SQ(*pIn - *pSupportb), dotV,1);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,2) + SQ(*pIn - *pSupportc), dotV,2);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,3) + SQ(*pIn - *pSupportd), dotV,3);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,0) + ARM_SQ(*pIn - *pSupporta), dotV,0);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,1) + ARM_SQ(*pIn - *pSupportb), dotV,1);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,2) + ARM_SQ(*pIn - *pSupportc), dotV,2);
dotV = vsetq_lane_f32(vgetq_lane_f32(dotV,3) + ARM_SQ(*pIn - *pSupportd), dotV,3);

pSupporta++;
pSupportb++;
Expand Down Expand Up @@ -478,7 +478,7 @@ void arm_svm_rbf_predict_f32(
while (blkCnt > 0U)
{

dot = dot + SQ(*pIn - *pSupport);
dot = dot + ARM_SQ(*pIn - *pSupport);
pIn++;
pSupport++;

Expand Down Expand Up @@ -507,7 +507,7 @@ void arm_svm_rbf_predict_f32(
dot=0;
for(j=0; j < S->vectorDimension; j++)
{
dot = dot + SQ(in[j] - *pSupport);
dot = dot + ARM_SQ(in[j] - *pSupport);
pSupport++;
}
sum += S->dualCoefficients[i] * expf(-S->gamma * dot);
Expand Down
13 changes: 5 additions & 8 deletions Testing/cmsis_build/runall.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,11 @@ def runAVH(build,core):
}

# Override previous solutions for more restricted testing.
#solutions={
# 'test_ac6.csolution.yml':[
# # ("VHT-Corstone-310","CS310"),
# ("VHT_M7","M7DP"),
# ("VHT_M7_UNROLLED","M7DP"),
# ("VHT_M0P","M0plus")
# ]
#}
solutions={
'test_ac6.csolution.yml':[
("VHT-Corstone-300","CS300"),
]
}

HTMLHEADER="""<html>
<header>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT-Corstone-300.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT-Corstone-310.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M0P.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M23.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M3.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M33.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M4.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M7.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down
2 changes: 1 addition & 1 deletion Testing/cmsis_build/test.Release+VHT_M7_UNROLLED.cprj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd">
<created timestamp="2023-08-21T08:28:05" tool="csolution 2.0.0"/>
<created timestamp="2023-10-25T07:44:53" tool="csolution 2.0.0"/>

<info isLayer="false">
<description>Automatically generated project</description>
Expand Down

0 comments on commit 00bab39

Please sign in to comment.