OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "main.h" | 5 #include "main.h" |
6 | 6 |
7 uint64_t TimeBench(BenchFunc func, int iter) { | 7 uint64_t TimeBench(BenchFunc func, int iter) { |
8 SwapBuffers(); | 8 SwapBuffers(); |
9 glFinish(); | 9 glFinish(); |
10 uint64_t time1 = GetUTime(); | 10 uint64_t time1 = GetUTime(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 if (count < 2) { | 48 if (count < 2) { |
49 *slope = 0.f; | 49 *slope = 0.f; |
50 *bias = 0; | 50 *bias = 0; |
51 } | 51 } |
52 *slope = static_cast<float>(sum_x * sum_y - count * sum_xy) / | 52 *slope = static_cast<float>(sum_x * sum_y - count * sum_xy) / |
53 (sum_x * sum_x - count * sum_x2); | 53 (sum_x * sum_x - count * sum_x2); |
54 *bias = (sum_x * sum_xy - sum_x2 * sum_y) / (sum_x * sum_x - count * sum_x2); | 54 *bias = (sum_x * sum_xy - sum_x2 * sum_y) / (sum_x * sum_x - count * sum_x2); |
55 return true; | 55 return true; |
56 } | 56 } |
OLD | NEW |