Changeset 140 for trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.c
- Timestamp:
- Mar 9, 2011, 4:11:43 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.c
r134 r140 6 6 void benchmark (void) 7 7 { 8 /* if(procnum() != 0) */ 9 /* EXIT(0); */ 10 11 int result = 0; 8 int result = 0; 9 int num_cpu = procnum(); 12 10 int cycle_begin = cycle_begin = cpu_cycles(); 13 14 switch (procnum()) 15 { 16 default : 17 { 11 12 if (num_cpu < BENCHMARK_NB_THREAD) 13 switch (num_cpu) 14 { 15 default : 16 { 18 17 #if BENCHMARK_MATRIX_MULTIPLICATION_MT 19 int result_mm_mt = benchmark_matrix_multiplication_mt();20 result += result_mm_mt;18 int result_mm_mt = benchmark_matrix_multiplication_mt(); 19 result += result_mm_mt; 21 20 #endif 22 21 #if BENCHMARK_DHRYSTONE 23 int result_dhrystone = benchmark_dhrystone();24 result += result_dhrystone;22 int result_dhrystone = benchmark_dhrystone(); 23 result += result_dhrystone; 25 24 #endif 26 #if BENCHMARK_SORT 27 int result_sort = benchmark_sort(); 28 result += result_sort; 25 #if BENCHMARK_SORT_ALL 26 int result_sort_all = benchmark_sort_all(); 27 result += result_sort_all; 28 #endif 29 #if BENCHMARK_SORT_BUBBLE 30 int result_sort_bubble = benchmark_sort_bubble(); 31 result += result_sort_bubble; 32 #endif 33 #if BENCHMARK_SORT_INSERTION 34 int result_sort_insertion = benchmark_sort_insertion(); 35 result += result_sort_insertion; 36 #endif 37 #if BENCHMARK_SORT_SELECTION 38 int result_sort_selection = benchmark_sort_selection(); 39 result += result_sort_selection; 40 #endif 41 #if BENCHMARK_SORT_SHELL 42 int result_sort_shell = benchmark_sort_shell(); 43 result += result_sort_shell; 29 44 #endif 30 45 #if BENCHMARK_MATRIX_MULTIPLICATION_ST 31 int result_mm_st = benchmark_matrix_multiplication_st();32 result += result_mm_st;46 int result_mm_st = benchmark_matrix_multiplication_st(); 47 result += result_mm_st; 33 48 #endif 34 35 printf("\n"); 36 printf("--------------------------------\n"); 37 printf( "Partial results :\n"); 49 #if BENCHMARK_SELF_CODE_MODIFYING 50 int result_self_code_modifying = benchmark_self_code_modifying(); 51 result += result_self_code_modifying; 52 #endif 53 54 printf("\n"); 55 printf("--------------------------------\n"); 56 printf( "Partial results :\n"); 38 57 #if BENCHMARK_MATRIX_MULTIPLICATION_MT 39 printf(" * MM MT: %d\n",result_mm_mt);58 printf(" * MM MT : %d\n",result_mm_mt); 40 59 #endif 41 60 #if BENCHMARK_DHRYSTONE 42 printf(" * DHRYSTONE: %d\n",result_dhrystone);61 printf(" * DHRYSTONE : %d\n",result_dhrystone); 43 62 #endif 44 #if BENCHMARK_SORT 45 printf(" * SORT : %d\n",result_sort); 63 #if BENCHMARK_SORT_ALL 64 printf(" * SORT_ALL : %d\n",result_sort_all); 65 #endif 66 #if BENCHMARK_SORT_BUBBLE 67 printf(" * SORT_BUBBLE : %d\n",result_sort_bubble); 68 #endif 69 #if BENCHMARK_SORT_INSERTION 70 printf(" * SORT_INSERTION : %d\n",result_sort_insertion); 71 #endif 72 #if BENCHMARK_SORT_SELECTION 73 printf(" * SORT_SELECTION : %d\n",result_sort_selection); 74 #endif 75 #if BENCHMARK_SORT_SHELL 76 printf(" * SORT_SHELL : %d\n",result_sort_shell); 46 77 #endif 47 78 #if BENCHMARK_MATRIX_MULTIPLICATION_ST 48 printf(" * MM ST: %d\n",result_mm_st);79 printf(" * MM ST : %d\n",result_mm_st); 49 80 #endif 50 printf("--------------------------------\n"); 51 break; 81 #if BENCHMARK_SELF_CODE_MODIFYING 82 printf(" * SELF_CODE_MODIFYING : %d\n",result_self_code_modifying); 83 #endif 84 printf("--------------------------------\n"); 85 break; 86 } 52 87 } 53 }54 88 55 89 printf("\n");
Note: See TracChangeset
for help on using the changeset viewer.