#include "riscv_math.h"
#include "math_helper.h"
#include <stdio.h>
#define SNR_THRESHOLD 77
{
782.0, 7577.0, 470.0, 4505.0
};
{
1.0, 32.0, 4.0, 128.0,
1.0, 32.0, 64.0, 2048.0,
1.0, 16.0, 4.0, 64.0,
1.0, 16.0, 64.0, 1024.0,
};
const float32_t xRef_f32[4] = {73.0, 8.0, 21.25, 2.875};
int32_t main(void)
{
#if (defined(__riscv_vector))
__RV_CSR_SET(CSR_MSTATUS, 0x200);
#endif
uint32_t srcRows, srcColumns;
srcRows = 4;
srcColumns = 4;
srcRows = 4;
srcColumns = 4;
srcRows = 4;
srcColumns = 4;
srcRows = 4;
srcColumns = 4;
srcRows = 4;
srcColumns = 1;
srcRows = 4;
srcColumns = 1;
snr = riscv_snr_f32((
float32_t *)xRef_f32, X_f32, 4);
if ( snr > SNR_THRESHOLD)
{
printf("passed\n");
return 0;
}
else
{
printf("failed\n");
return 1;
}
}