| 86 | |
| 87 | template <typename T> |
| 88 | void run_exprtk_benchmark(T& x, T& y, |
| 89 | exprtk::expression<T>& expression, |
| 90 | const std::string& expr_string) |
| 91 | { |
| 92 | T total = T(0); |
| 93 | unsigned int count = 0; |
| 94 | |
| 95 | exprtk::timer timer; |
| 96 | timer.start(); |
| 97 | |
| 98 | for (x = global_lower_bound_x; x <= global_upper_bound_x; x += global_delta) |
| 99 | { |
| 100 | for (y = global_lower_bound_y; y <= global_upper_bound_y; y += global_delta) |
| 101 | { |
| 102 | total += expression.value(); |
| 103 | ++count; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | timer.stop(); |
| 108 | |
| 109 | if (T(0) != total) |
| 110 | printf("[exprtk] Total Time:%12.8f Rate:%14.3fevals/sec Expression: %s\n", |
| 111 | timer.time(), |
| 112 | count / timer.time(), |
| 113 | expr_string.c_str()); |
| 114 | else |
| 115 | printf("run_exprtk_benchmark() - Error running benchmark for expression: %s\n",expr_string.c_str()); |
| 116 | } |
| 117 | |
| 118 | template <typename T> struct native; |
| 119 | |