// See LICENSE for license details. //************************************************************************** // Median filter bencmark //-------------------------------------------------------------------------- // // This benchmark performs a 1D three element median filter. The // input data (and reference data) should be generated using the // median_gendata.pl perl script and dumped to a file named // dataset1.h You should not change anything except the // HOST_DEBUG and PREALLOCATE macros for your timing run. #include "util.h" #include "median.h" //-------------------------------------------------------------------------- // Input/Reference Data #include "dataset1.h" //-------------------------------------------------------------------------- // Main int main( int argc, char* argv[] ) { int results_data[DATA_SIZE]; // Output the input array printArray( "input", DATA_SIZE, input_data ); printArray( "verify", DATA_SIZE, verify_data ); #if PREALLOCATE // If needed we preallocate everything in the caches median( DATA_SIZE, input_data, results_data ); #endif // Do the filter setStats(1); median( DATA_SIZE, input_data, results_data ); setStats(0); // Print out the results printArray( "results", DATA_SIZE, results_data ); // Check the results return verify( DATA_SIZE, results_data, verify_data ); }