Changeset 1309 for trunk/test/benchmark
 Timestamp:
 Apr 29, 2012, 10:02:20 PM (10 years ago)
 Location:
 trunk/test/benchmark
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/benchmark/half.cpp
r942 r1309 47 47 48 48 /* Copy float */ 49 timer.Get Ms();49 timer.Get(); 50 50 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 51 51 pf[i] = pf[i + 1]; 52 result[0] += timer.Get Ms();52 result[0] += timer.Get(); 53 53 54 54 /* Convert half to float (array) */ 55 timer.Get Ms();55 timer.Get(); 56 56 half::convert(pf, ph, HALF_TABLE_SIZE); 57 result[1] += timer.Get Ms();57 result[1] += timer.Get(); 58 58 59 59 /* Convert half to float (fast) */ 60 timer.Get Ms();60 timer.Get(); 61 61 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 62 62 pf[i] = (float)ph[i]; 63 result[2] += timer.Get Ms();63 result[2] += timer.Get(); 64 64 65 65 /* Add a half to every float */ 66 timer.Get Ms();66 timer.Get(); 67 67 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 68 68 pf[i] += ph[i]; 69 result[3] += timer.Get Ms();69 result[3] += timer.Get(); 70 70 71 71 /* Copy half */ 72 timer.Get Ms();72 timer.Get(); 73 73 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 74 74 ph[i] = ph[i + 1]; 75 result[4] += timer.Get Ms();75 result[4] += timer.Get(); 76 76 77 77 /* Change sign of every half */ 78 timer.Get Ms();78 timer.Get(); 79 79 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 80 80 ph[i] = ph[i]; 81 result[5] += timer.Get Ms();81 result[5] += timer.Get(); 82 82 83 83 /* Convert float to half (array) */ 84 timer.Get Ms();84 timer.Get(); 85 85 half::convert(ph, pf, HALF_TABLE_SIZE); 86 result[6] += timer.Get Ms();86 result[6] += timer.Get(); 87 87 88 88 /* Convert float to half (fast) */ 89 timer.Get Ms();89 timer.Get(); 90 90 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 91 91 ph[i] = (half)pf[i]; 92 result[7] += timer.Get Ms();92 result[7] += timer.Get(); 93 93 94 94 /* Convert float to half (accurate) */ 95 timer.Get Ms();95 timer.Get(); 96 96 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 97 97 ph[i] = half::makeaccurate(pf[i]); 98 result[8] += timer.Get Ms();98 result[8] += timer.Get(); 99 99 100 100 /* Add a float to every half */ 101 timer.Get Ms();101 timer.Get(); 102 102 for (size_t i = 0; i < HALF_TABLE_SIZE; i++) 103 103 ph[i] += pf[i]; 104 result[9] += timer.Get Ms();104 result[9] += timer.Get(); 105 105 } 106 106 … … 109 109 110 110 for (size_t i = 0; i < sizeof(result) / sizeof(*result); i++) 111 result[i] *= 1 000000.0f / (HALF_TABLE_SIZE * HALF_RUNS);111 result[i] *= 1e9f / (HALF_TABLE_SIZE * HALF_RUNS); 112 112 113 113 Log::Info(" ns/elem\n"); 
trunk/test/benchmark/real.cpp
r1020 r1309 37 37 38 38 real fib1 = 1.0, fib2 = 1.0; 39 timer.Get Ms();39 timer.Get(); 40 40 for (size_t i = 0; i < REAL_TABLE_SIZE; i++) 41 41 { … … 44 44 fib2 = tmp; 45 45 } 46 result[0] += timer.Get Ms();46 result[0] += timer.Get(); 47 47 48 48 real fact = 1.0; 49 timer.Get Ms();49 timer.Get(); 50 50 for (size_t i = 0; i < REAL_TABLE_SIZE; i++) 51 51 fact = fact * real(1.0 + i); 52 result[1] += timer.Get Ms();52 result[1] += timer.Get(); 53 53 54 54 real invfact = 1.0; 55 timer.Get Ms();55 timer.Get(); 56 56 for (size_t i = 0; i < REAL_TABLE_SIZE; i++) 57 57 invfact = invfact / real(1.0 + i); 58 result[2] += timer.Get Ms();58 result[2] += timer.Get(); 59 59 60 timer.Get Ms();60 timer.Get(); 61 61 for (size_t i = 0; i < REAL_TABLE_SIZE / 128; i++) 62 62 sin(real(0.01 * i)); 63 result[3] += timer.Get Ms() * 128;63 result[3] += timer.Get() * 128; 64 64 65 timer.Get Ms();65 timer.Get(); 66 66 for (size_t i = 0; i < REAL_TABLE_SIZE / 128; i++) 67 67 exp((real)(int)(i  REAL_TABLE_SIZE / 256)); 68 result[4] += timer.Get Ms() * 128;68 result[4] += timer.Get() * 128; 69 69 } 70 70 71 71 for (size_t i = 0; i < sizeof(result) / sizeof(*result); i++) 72 result[i] *= 1 000000.0f / (REAL_TABLE_SIZE * REAL_RUNS);72 result[i] *= 1e9f / (REAL_TABLE_SIZE * REAL_RUNS); 73 73 74 74 Log::Info(" ns/elem\n"); 
trunk/test/benchmark/trig.cpp
r1189 r1309 65 65 66 66 /* Sin */ 67 timer.Get Ms();67 timer.Get(); 68 68 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 69 69 #if defined __GNUC__ && !defined __SNC__ … … 72 72 pf2[i] = sinf(pf[i]); 73 73 #endif 74 result[0] += timer.Get Ms();74 result[0] += timer.Get(); 75 75 76 76 /* Fast sin */ 77 timer.Get Ms();77 timer.Get(); 78 78 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 79 79 #if defined HAVE_FASTMATH_H && !defined __native_client__ … … 82 82 pf2[i] = sinf(pf[i]); 83 83 #endif 84 result[1] += timer.Get Ms();84 result[1] += timer.Get(); 85 85 86 86 /* Lol sin */ 87 timer.Get Ms();87 timer.Get(); 88 88 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 89 89 pf2[i] = lol_sin(pf[i]); 90 result[2] += timer.Get Ms();90 result[2] += timer.Get(); 91 91 92 92 /* Cos */ 93 timer.Get Ms();93 timer.Get(); 94 94 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 95 95 #if defined __GNUC__ && !defined __SNC__ … … 98 98 pf2[i] = cosf(pf[i]); 99 99 #endif 100 result[3] += timer.Get Ms();100 result[3] += timer.Get(); 101 101 102 102 /* Fast cos */ 103 timer.Get Ms();103 timer.Get(); 104 104 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 105 105 #if defined HAVE_FASTMATH_H && !defined __native_client__ … … 108 108 pf2[i] = cosf(pf[i]); 109 109 #endif 110 result[4] += timer.Get Ms();110 result[4] += timer.Get(); 111 111 112 112 /* Lol cos */ 113 timer.Get Ms();113 timer.Get(); 114 114 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 115 115 pf2[i] = lol_cos(pf[i]); 116 result[5] += timer.Get Ms();116 result[5] += timer.Get(); 117 117 118 118 /* Sin & cos */ 119 timer.Get Ms();119 timer.Get(); 120 120 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 121 121 { … … 128 128 #endif 129 129 } 130 result[6] += timer.Get Ms();130 result[6] += timer.Get(); 131 131 132 132 /* Fast sin & cos */ 133 timer.Get Ms();133 timer.Get(); 134 134 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 135 135 { … … 142 142 #endif 143 143 } 144 result[7] += timer.Get Ms();144 result[7] += timer.Get(); 145 145 146 146 /* Lol sincos */ 147 timer.Get Ms();147 timer.Get(); 148 148 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 149 149 lol_sincos(pf[i], &pf2[i], &pf3[i]); 150 result[8] += timer.Get Ms();150 result[8] += timer.Get(); 151 151 152 152 /* Tan */ 153 timer.Get Ms();153 timer.Get(); 154 154 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 155 155 #if defined __GNUC__ && !defined __SNC__ … … 158 158 pf2[i] = tanf(pf[i]); 159 159 #endif 160 result[9] += timer.Get Ms();160 result[9] += timer.Get(); 161 161 162 162 /* Fast tan */ 163 timer.Get Ms();163 timer.Get(); 164 164 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 165 165 #if defined HAVE_FASTMATH_H && !defined __native_client__ … … 168 168 pf2[i] = tanf(pf[i]); 169 169 #endif 170 result[10] += timer.Get Ms();170 result[10] += timer.Get(); 171 171 172 172 /* Lol tan */ 173 timer.Get Ms();173 timer.Get(); 174 174 for (size_t i = 0; i < TRIG_TABLE_SIZE; i++) 175 175 pf2[i] = lol_tan(pf[i]); 176 result[11] += timer.Get Ms();176 result[11] += timer.Get(); 177 177 } 178 178 … … 182 182 183 183 for (size_t i = 0; i < sizeof(result) / sizeof(*result); i++) 184 result[i] *= 1 000000.0f / (TRIG_TABLE_SIZE * TRIG_RUNS);184 result[i] *= 1e9f / (TRIG_TABLE_SIZE * TRIG_RUNS); 185 185 186 186 Log::Info(" ns/elem\n"); 
trunk/test/benchmark/vector.cpp
r1257 r1309 45 45 46 46 /* Copy matrices */ 47 timer.Get Ms();47 timer.Get(); 48 48 for (size_t i = 0; i < MATRIX_TABLE_SIZE; i++) 49 49 pm[i] = pm[i + 1]; 50 result[0] += timer.Get Ms();50 result[0] += timer.Get(); 51 51 52 52 /* Determinant */ 53 timer.Get Ms();53 timer.Get(); 54 54 for (size_t i = 0; i < MATRIX_TABLE_SIZE; i++) 55 55 pf[i] = determinant(pm[i]); 56 result[1] += timer.Get Ms();56 result[1] += timer.Get(); 57 57 58 58 /* Multiply matrices */ 59 timer.Get Ms();59 timer.Get(); 60 60 for (size_t i = 0; i < MATRIX_TABLE_SIZE; i++) 61 61 pm[i] *= pm[i + 1]; 62 result[2] += timer.Get Ms();62 result[2] += timer.Get(); 63 63 64 64 /* Add matrices */ 65 timer.Get Ms();65 timer.Get(); 66 66 for (size_t i = 0; i < MATRIX_TABLE_SIZE; i++) 67 67 pm[i] += pm[i + 1]; 68 result[3] += timer.Get Ms();68 result[3] += timer.Get(); 69 69 70 70 /* Invert matrix */ 71 timer.Get Ms();71 timer.Get(); 72 72 for (size_t i = 0; i < MATRIX_TABLE_SIZE; i++) 73 73 pm[i] = inverse(pm[i]); 74 result[4] += timer.Get Ms();74 result[4] += timer.Get(); 75 75 } 76 76 … … 79 79 80 80 for (size_t i = 0; i < sizeof(result) / sizeof(*result); i++) 81 result[i] *= 1 000000.0f / (MATRIX_TABLE_SIZE * MATRIX_RUNS);81 result[i] *= 1e9f / (MATRIX_TABLE_SIZE * MATRIX_RUNS); 82 82 83 83 Log::Info(" ns/elem\n");
Note: See TracChangeset
for help on using the changeset viewer.