Skip to content

Commit

Permalink
bench: resolve lint errors in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Jul 28, 2024
1 parent 137e31b commit 2777e4b
Show file tree
Hide file tree
Showing 874 changed files with 6,479 additions and 8,546 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Prints the TAP version.
*/
void print_version( void ) {
static void print_version( void ) {
printf( "TAP version 13\n" );
}

Expand All @@ -42,7 +42,7 @@ void print_version( void ) {
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
static void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
Expand All @@ -57,7 +57,7 @@ void print_summary( int total, int passing ) {
* @param iterations number of iterations
* @param elapsed elapsed time in seconds
*/
void print_results( int iterations, double elapsed ) {
static void print_results( int iterations, double elapsed ) {
double rate = (double)iterations / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", iterations );
Expand All @@ -71,18 +71,18 @@ void print_results( int iterations, double elapsed ) {
*
* @return clock time
*/
double tic( void ) {
static double tic( void ) {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}

/**
* Generates a random number on the interval [0,1].
* Generates a random number on the interval [0,1).
*
* @return random number
*/
float rand_float( void ) {
static float rand_float( void ) {
int r = rand();
return (float)r / ( (float)RAND_MAX + 1.0f );
}
Expand All @@ -94,7 +94,7 @@ float rand_float( void ) {
* @param len array length
* @return elapsed time in seconds
*/
double benchmark( int iterations, int len ) {
static double benchmark( int iterations, int len ) {
double elapsed;
float x[ len*2 ];
float y[ len*2 ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
* limitations under the License.
*/

/**
* Benchmark `cscal`.
*/
#include "stdlib/blas/base/cscal.h"
#include "stdlib/complex/float32/ctor.h"
#include <stdlib.h>
Expand All @@ -36,7 +33,7 @@
/**
* Prints the TAP version.
*/
void print_version( void ) {
static void print_version( void ) {
printf( "TAP version 13\n" );
}

Expand All @@ -46,7 +43,7 @@ void print_version( void ) {
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
static void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
Expand All @@ -61,7 +58,7 @@ void print_summary( int total, int passing ) {
* @param iterations number of iterations
* @param elapsed elapsed time in seconds
*/
void print_results( int iterations, double elapsed ) {
static void print_results( int iterations, double elapsed ) {
double rate = (double)iterations / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", iterations );
Expand All @@ -75,18 +72,18 @@ void print_results( int iterations, double elapsed ) {
*
* @return clock time
*/
double tic( void ) {
static double tic( void ) {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}

/**
* Generates a random number on the interval [0,1].
* Generates a random number on the interval [0,1).
*
* @return random number
*/
float rand_float( void ) {
static float rand_float( void ) {
int r = rand();
return (float)r / ( (float)RAND_MAX + 1.0f );
}
Expand All @@ -98,7 +95,7 @@ float rand_float( void ) {
* @param len array length
* @return elapsed time in seconds
*/
double benchmark( int iterations, int len ) {
static double benchmark( int iterations, int len ) {
stdlib_complex64_t ca;
float cx[ len*2 ];
double elapsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Prints the TAP version.
*/
void print_version( void ) {
static void print_version( void ) {
printf( "TAP version 13\n" );
}

Expand All @@ -42,7 +42,7 @@ void print_version( void ) {
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
static void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
Expand All @@ -57,7 +57,7 @@ void print_summary( int total, int passing ) {
* @param iterations number of iterations
* @param elapsed elapsed time in seconds
*/
void print_results( int iterations, double elapsed ) {
static void print_results( int iterations, double elapsed ) {
double rate = (double)iterations / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", iterations );
Expand All @@ -71,18 +71,18 @@ void print_results( int iterations, double elapsed ) {
*
* @return clock time
*/
double tic( void ) {
static double tic( void ) {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}

/**
* Generates a random number on the interval [0,1].
* Generates a random number on the interval [0,1).
*
* @return random number
*/
float rand_float( void ) {
static float rand_float( void ) {
int r = rand();
return (float)r / ( (float)RAND_MAX + 1.0f );
}
Expand All @@ -94,7 +94,7 @@ float rand_float( void ) {
* @param len array length
* @return elapsed time in seconds
*/
double benchmark( int iterations, int len ) {
static double benchmark( int iterations, int len ) {
double elapsed;
float x[ len*2 ];
float y[ len*2 ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Prints the TAP version.
*/
void print_version( void ) {
static void print_version( void ) {
printf( "TAP version 13\n" );
}

Expand All @@ -42,7 +42,7 @@ void print_version( void ) {
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
static void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
Expand All @@ -57,7 +57,7 @@ void print_summary( int total, int passing ) {
* @param iterations number of iterations
* @param elapsed elapsed time in seconds
*/
void print_results( int iterations, double elapsed ) {
static void print_results( int iterations, double elapsed ) {
double rate = (double)iterations / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", iterations );
Expand All @@ -71,18 +71,18 @@ void print_results( int iterations, double elapsed ) {
*
* @return clock time
*/
double tic( void ) {
static double tic( void ) {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}

/**
* Generates a random number on the interval [0,1].
* Generates a random number on the interval [0,1).
*
* @return random number
*/
float rand_float( void ) {
static float rand_float( void ) {
int r = rand();
return (float)r / ( (float)RAND_MAX + 1.0f );
}
Expand All @@ -94,7 +94,7 @@ float rand_float( void ) {
* @param len array length
* @return elapsed time in seconds
*/
double benchmark( int iterations, int len ) {
static double benchmark( int iterations, int len ) {
double elapsed;
float x[ len*2 ];
float y[ len*2 ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Prints the TAP version.
*/
void print_version( void ) {
static void print_version( void ) {
printf( "TAP version 13\n" );
}

Expand All @@ -42,7 +42,7 @@ void print_version( void ) {
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
static void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
Expand All @@ -57,7 +57,7 @@ void print_summary( int total, int passing ) {
* @param iterations number of iterations
* @param elapsed elapsed time in seconds
*/
void print_results( int iterations, double elapsed ) {
static void print_results( int iterations, double elapsed ) {
double rate = (double)iterations / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", iterations );
Expand All @@ -71,18 +71,18 @@ void print_results( int iterations, double elapsed ) {
*
* @return clock time
*/
double tic( void ) {
static double tic( void ) {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}

/**
* Generates a random number on the interval [0,1].
* Generates a random number on the interval [0,1).
*
* @return random number
*/
double rand_double( void ) {
static double rand_double( void ) {
int r = rand();
return (double)r / ( (double)RAND_MAX + 1.0 );
}
Expand All @@ -94,7 +94,7 @@ double rand_double( void ) {
* @param len array length
* @return elapsed time in seconds
*/
double benchmark( int iterations, int len ) {
static double benchmark( int iterations, int len ) {
double elapsed;
double x[ len ];
double y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Prints the TAP version.
*/
void print_version( void ) {
static void print_version( void ) {
printf( "TAP version 13\n" );
}

Expand All @@ -42,7 +42,7 @@ void print_version( void ) {
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
static void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
Expand All @@ -57,7 +57,7 @@ void print_summary( int total, int passing ) {
* @param iterations number of iterations
* @param elapsed elapsed time in seconds
*/
void print_results( int iterations, double elapsed ) {
static void print_results( int iterations, double elapsed ) {
double rate = (double)iterations / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", iterations );
Expand All @@ -71,18 +71,18 @@ void print_results( int iterations, double elapsed ) {
*
* @return clock time
*/
double tic( void ) {
static double tic( void ) {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}

/**
* Generates a random number on the interval [0,1].
* Generates a random number on the interval [0,1).
*
* @return random number
*/
double rand_double( void ) {
static double rand_double( void ) {
int r = rand();
return (double)r / ( (double)RAND_MAX + 1.0 );
}
Expand All @@ -94,7 +94,7 @@ double rand_double( void ) {
* @param len array length
* @return elapsed time in seconds
*/
double benchmark( int iterations, int len ) {
static double benchmark( int iterations, int len ) {
double elapsed;
double x[ len ];
double y[ len ];
Expand Down
Loading

0 comments on commit 2777e4b

Please sign in to comment.