MCPcopy Create free account
hub / github.com/dmlc/parameter_server / templateTimes

Method templateTimes

src/util/sparse_matrix.h:111–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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_;

Callers

nothing calls this directly

Calls 3

evenDivideMethod · 0.80
startWorkersMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected