|
19 | 19 | #include <math.h> |
20 | 20 |
|
21 | 21 | #include "common/c_types_map.hpp" |
| 22 | +#include "common/compiler_workarounds.hpp" |
22 | 23 | #include "common/dnnl_thread.hpp" |
23 | 24 | #include "common/type_helpers.hpp" |
24 | 25 |
|
@@ -78,7 +79,8 @@ status_t ref_softmax_fwd_t::execute_forward_dense(const exec_ctx_t &ctx) const { |
78 | 79 |
|
79 | 80 | const int nthr = pd()->nthr_; |
80 | 81 |
|
81 | | - parallel_nd_ext(nthr, outer_size_, [=](int ithr, int, dim_t ou) { |
| 82 | + parallel_nd_ext(nthr, outer_size_, |
| 83 | + [= WA_THIS_COPY_CAPTURE](int ithr, int, dim_t ou) { |
82 | 84 | const void *src_data = reinterpret_cast<const char *>(src) |
83 | 85 | + ou * ou_stride * src_dt_size; |
84 | 86 | void *dst_data |
@@ -251,7 +253,8 @@ status_t ref_softmax_fwd_t::execute_forward_generic( |
251 | 253 | const auto axis_size = pd()->axis_size(true); |
252 | 254 | const int nthr = pd()->nthr_; |
253 | 255 |
|
254 | | - parallel_nd_ext(nthr, outer_size_, [=](int ithr, int, dim_t ou) { |
| 256 | + parallel_nd_ext(nthr, outer_size_, |
| 257 | + [= WA_THIS_COPY_CAPTURE](int ithr, int, dim_t ou) { |
255 | 258 | const dim_t thr_shift = ithr * axis_size; |
256 | 259 |
|
257 | 260 | float space_max_val = 0, space_denom_val = 0; |
@@ -344,7 +347,7 @@ status_t ref_softmax_bwd_t::execute_backward_dense( |
344 | 347 | // previous dimension. |
345 | 348 | const auto ou_stride = pd()->axis_size(); |
346 | 349 |
|
347 | | - parallel_nd(outer_size_, [=](dim_t ou) { |
| 350 | + parallel_nd(outer_size_, [= WA_THIS_COPY_CAPTURE](dim_t ou) { |
348 | 351 | float sbr = 0; |
349 | 352 | size_t off = ou * ou_stride; |
350 | 353 | if (pd()->is_softmax()) { |
@@ -412,7 +415,8 @@ status_t ref_softmax_bwd_t::execute_backward_generic( |
412 | 415 | ctx.zero_pad_output(DNNL_ARG_DIFF_SRC); |
413 | 416 | } |
414 | 417 |
|
415 | | - parallel_nd(outer_size_, inner_size_, [=](dim_t ou, dim_t in) { |
| 418 | + parallel_nd(outer_size_, inner_size_, |
| 419 | + [= WA_THIS_COPY_CAPTURE](dim_t ou, dim_t in) { |
416 | 420 | dim_t ou_in_offset = ou * channels_ * inner_size_ + in; |
417 | 421 | float sbr = 0; |
418 | 422 | for (int c = 0; c < channels_; ++c) { |
|
0 commit comments