2003-05-15 17:10:26 +00:00
|
|
|
// The contents of this file are subject to the Mozilla Public License
|
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
|
|
|
// http://www.mozilla.org/MPL/
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Contributor(s):
|
|
|
|
//
|
|
|
|
|
2002-05-21 23:11:09 +00:00
|
|
|
//#define RUN_TEST
|
|
|
|
|
|
|
|
#define THOUSAND 1000
|
|
|
|
#define MILLION THOUSAND*THOUSAND
|
|
|
|
|
|
|
|
#define D_LOOP_ITERS 1*MILLION
|
|
|
|
#define I_LOOP_ITERS 1*MILLION
|
2003-03-20 19:16:28 +00:00
|
|
|
#define MEM_SIZE 1*MILLION
|
2002-05-21 23:11:09 +00:00
|
|
|
|
|
|
|
#define NUM_DOUBLES 28
|
|
|
|
#define NUM_INTS 28
|
|
|
|
|
2003-04-01 03:28:37 +00:00
|
|
|
#define CACHE_MIN 1024 // smallest cache (in words)
|
|
|
|
#define CACHE_MAX 512*1024 // largest cache
|
|
|
|
#define STRIDE_MIN 1 // smallest stride (in words)
|
|
|
|
#define STRIDE_MAX 128 // largest stride
|
|
|
|
#define SAMPLE 10 // to get a larger time sample
|
2002-05-21 23:11:09 +00:00
|
|
|
#define SECS_PER_RUN 0.2
|
|
|
|
|
2003-04-01 03:28:37 +00:00
|
|
|
#define MAX_CPU_BENCHMARKS_SECONDS 60
|
|
|
|
#define CPU_BENCHMARKS_RUNNING 0
|
|
|
|
#define CPU_BENCHMARKS_COMPLETE 1
|
|
|
|
#define CPU_BENCHMARKS_NOT_RUNNING 2
|
|
|
|
#define CPU_BENCHMARKS_ERROR 3
|
2002-12-09 23:51:55 +00:00
|
|
|
|
2002-05-21 23:11:09 +00:00
|
|
|
int check_cache_size( int mem_size );
|
2003-03-20 19:16:28 +00:00
|
|
|
double double_flop_test( int iterations, int print_debug );
|
|
|
|
double int_op_test( int iterations, int print_debug );
|
|
|
|
double bandwidth_test( int iterations, int print_debug );
|
2002-05-21 23:11:09 +00:00
|
|
|
void run_test_suite( double num_secs_per_test );
|
|
|
|
double run_double_prec_test( double num_secs );
|
|
|
|
double run_int_test( double num_secs );
|
|
|
|
double run_mem_bandwidth_test( double num_secs );
|
2003-03-20 19:16:28 +00:00
|
|
|
int set_test_timer(double num_secs);
|
|
|
|
int destroy_test_timer();
|
2002-05-21 23:11:09 +00:00
|
|
|
|
|
|
|
|