| 69 | } |
| 70 | |
| 71 | inline int adjust_num_threads(int m) { |
| 72 | int actual_nth = get_max_threads(); |
| 73 | if (m == 1) |
| 74 | return actual_nth; |
| 75 | return std::max(1, (actual_nth >> 1) * 2); |
| 76 | } |
| 77 | |
| 78 | template <typename func_t> inline void parallel_2d(int m, int n, const func_t& f) { |
| 79 | // make sure we have even num_threads |
no test coverage detected