Skip to content

Commit

Permalink
src: cpu: simple_reorder: fix simd pragmas for compilers supporting o…
Browse files Browse the repository at this point in the history
…nly old OpenMP spec
  • Loading branch information
Roman Dubtsov committed Oct 27, 2017
1 parent 0c1e414 commit 9e83c81
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cpu/simple_reorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,14 +1360,22 @@ struct simple_reorder_impl<SIMPLE_REORDER_TEMPL_CALL,
const size_t nelems = input_d.nelems();

if (alpha == 1.0 && beta == 0.0) {
# if _OPENMP >= 201307
# pragma omp parallel for simd schedule(static)
for (int e = 0; e < nelems; ++e) {
# else
# pragma omp parallel for
# endif
for (size_t e = 0; e < nelems; ++e) {
output[output_d.off_l(e)] =
data_t<type_o>(input[input_d.off_l(e)]);
}
} else {
# if _OPENMP >= 201307
# pragma omp parallel for simd schedule(static)
for (int e = 0; e < nelems; ++e) {
# else
# pragma omp parallel for
# endif
for (size_t e = 0; e < nelems; ++e) {
output[output_d.off_l(e)] = data_t<type_o>(
alpha * input[input_d.off_l(e)]
+ (beta ? beta * output[output_d.off_l(e)] : 0));
Expand Down

0 comments on commit 9e83c81

Please sign in to comment.