From 22efb1c8252d16882d57ff68b64126dd5f9dd769 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 19 Aug 2010 12:42:02 -0700 Subject: [PATCH] Fix printing of performance data in tests --- orc-test/orctest.c | 13 +++++++++---- tools/orcc.c | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/orc-test/orctest.c b/orc-test/orctest.c index 7ddc1b2..673eb2b 100644 --- a/orc-test/orctest.c +++ b/orc-test/orctest.c @@ -951,14 +951,19 @@ orc_test_performance_full (OrcProgram *program, int flags, orc_executor_set_stride (ex, j, src[j-ORC_VAR_S1]->stride); } } - orc_profile_start (&prof); - orc_executor_run (ex); - orc_profile_stop (&prof); + if (flags & ORC_TEST_FLAGS_BACKUP) { + orc_profile_start (&prof); + orc_executor_run_backup (ex); + orc_profile_stop (&prof); + } else { + orc_profile_start (&prof); + orc_executor_run (ex); + orc_profile_stop (&prof); + } } ORC_DEBUG ("done running"); orc_profile_get_ave_std (&prof, &ave, &std); - //printf("%g %g\n", ave/(n*m), std/(n*m)); for(i=0;i<4;i++){ if (dest_exec[i]) orc_array_free (dest_exec[i]); diff --git a/tools/orcc.c b/tools/orcc.c index b500598..97d769b 100644 --- a/tools/orcc.c +++ b/tools/orcc.c @@ -1005,8 +1005,8 @@ output_code_test (OrcProgram *p, FILE *output) fprintf(output, " }\n"); fprintf(output, "\n"); fprintf(output, " if (benchmark) {\n"); - fprintf(output, " printf (\" cycles (backup) : \");\n"); - fprintf(output, " orc_test_performance (p, ORC_TEST_FLAGS_BACKUP);\n"); + fprintf(output, " printf (\" cycles (backup) : %%g\\n\",\n"); + fprintf(output, " orc_test_performance_full (p, ORC_TEST_FLAGS_BACKUP, NULL));\n"); fprintf(output, " }\n"); fprintf(output, "\n"); fprintf(output, " ret = orc_test_compare_output (p);\n"); @@ -1019,8 +1019,8 @@ output_code_test (OrcProgram *p, FILE *output) fprintf(output, " }\n"); fprintf(output, "\n"); fprintf(output, " if (benchmark) {\n"); - fprintf(output, " printf (\" cycles (compiled): \");\n"); - fprintf(output, " orc_test_performance (p, 0);\n"); + fprintf(output, " printf (\" cycles (compiled): %%g\\n\",\n"); + fprintf(output, " orc_test_performance_full (p, 0, NULL));\n"); fprintf(output, " }\n"); fprintf(output, "\n"); fprintf(output, " orc_program_free (p);\n"); -- 2.7.4