Skip to content

Commit 9e3fc38

Browse files
author
Arjun Ramaswami
committed
review changes: bool in verify
1 parent 0d215f9 commit 9e3fc38

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/common/verify_fftw.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Author: Arjun Ramaswami
22
#include <stdio.h>
33
#include <math.h>
4+
#include <stdbool.h>
45
#include "fftfpga/fftfpga.h"
56

67
#ifdef USE_FFTW
@@ -11,9 +12,9 @@
1112
* \param fftw_data: pointer to fft3d sized allocation of sp complex data for fftw cpu computation
1213
* \param N: number of points per dimension of FFT3d
1314
* \param inverse: 1 if inverse
14-
* \return 0 if verification passed, 1 failed
15+
* \return true if verification passed
1516
*/
16-
int verify_sp_fft3d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
17+
bool verify_sp_fft3d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
1718

1819
// Copy inp data to verify using FFTW
1920
// requires allocating data specifically for FFTW computation
@@ -70,10 +71,10 @@ int verify_sp_fft3d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
7071
printf("\tSignal to noise ratio on output sample: %f --> %s\n\n", db, db > 120 ? "PASSED" : "FAILED");
7172

7273
if(db > 120){
73-
return 1;
74+
return true;
7475
}
7576
else{
76-
return 0;
77+
return false;
7778
}
7879

7980
}
@@ -84,9 +85,9 @@ int verify_sp_fft3d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
8485
* \param fftw_data: pointer to fft2d sized allocation of sp complex data for fftw cpu computation
8586
* \param N: number of points per dimension of FFT2d
8687
* \param inverse: 1 if inverse
87-
* \return 0 if verification passed, 1 failed
88+
* \return true if verification passed
8889
*/
89-
int verify_sp_fft2d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
90+
bool verify_sp_fft2d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
9091

9192
// Copy inp data to verify using FFTW
9293
// requires allocating data specifically for FFTW computation
@@ -143,10 +144,10 @@ int verify_sp_fft2d_fftw(float2 *fpgaout, float2 *verify, int N, int inverse){
143144
printf("\tSignal to noise ratio on output sample: %f --> %s\n\n", db, db > 120 ? "PASSED" : "FAILED");
144145

145146
if(db > 120){
146-
return 1;
147+
return true;
147148
}
148149
else{
149-
return 0;
150+
return false;
150151
}
151152

152153
}

0 commit comments

Comments
 (0)