Skip to content

Commit

Permalink
Merge pull request apache#97 from hjk41/master
Browse files Browse the repository at this point in the history
enable OpenMP for MapPlan
  • Loading branch information
hjk41 committed Feb 2, 2016
2 parents ec3e314 + 12299cb commit 1286bea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mshadow/tensor_cpu-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ inline void MapPlan(TRValue<R, cpu, dim, DType> *dst,
const expr::Plan<E, DType> &plan) {
Shape<2> shape = expr::ShapeCheck<dim, R>::Check(dst->self()).FlatTo2D();
expr::Plan<R, DType> dplan = expr::MakePlan(dst->self());
for (index_t y = 0; y < shape[0]; ++y) {
#pragma omp parallel for
for (int y = 0; y < shape[0]; ++y) {
for (index_t x = 0; x < shape[1]; ++x) {
// trust your compiler! -_- they will optimize it
Saver::Save(dplan.REval(y, x), plan.Eval(y, x));
Expand Down

0 comments on commit 1286bea

Please sign in to comment.