| 109 | // multi-thread, both x and y are pre-allocated |
| 110 | template <typename W> |
| 111 | void templateTimes(const W* x, W* y) const { |
| 112 | SizeR row_range(0, rows()); |
| 113 | int num_threads = FLAGS_num_threads; |
| 114 | CHECK_GT(num_threads, 0); |
| 115 | |
| 116 | ThreadPool pool(num_threads); |
| 117 | int num_tasks = rowMajor() ? num_threads * 10 : num_threads; |
| 118 | for (int i = 0; i < num_tasks; ++i) { |
| 119 | pool.add([this, x, y, row_range, num_tasks, i](){ |
| 120 | rangeTimes(row_range.evenDivide(num_tasks, i), x, y); |
| 121 | }); |
| 122 | } |
| 123 | pool.startWorkers(); |
| 124 | } |
| 125 | |
| 126 | private: |
| 127 | SArray<size_t> offset_; |
nothing calls this directly
no test coverage detected