diff --git a/onnxruntime/core/providers/cpu/rnn/deep_cpu_gru.cc b/onnxruntime/core/providers/cpu/rnn/deep_cpu_gru.cc index e34f4c8848..64fe3cec62 100644 --- a/onnxruntime/core/providers/cpu/rnn/deep_cpu_gru.cc +++ b/onnxruntime/core/providers/cpu/rnn/deep_cpu_gru.cc @@ -383,15 +383,14 @@ Status DeepCpuGruOp::ComputeImpl(OpKernelContext& context) const { gsl::span hidden_output_2 = hidden_output.subspan(hidden_output_size_per_direction, hidden_output_size_per_direction); -#ifndef USE_MKLDNN - +#if defined(USE_MLAS) && !defined(USE_OPENMP) #ifdef USE_EIGEN_THREADPOOL auto fn = #else std::packaged_task task_fw{ #endif [&]() { -#endif // ! USE_MKLDNN +#endif // USE_MLAS && ! USE_OPENMP std::unique_ptr> fw = std::make_unique>( alloc, logger, seq_length, batch_size, input_size, hidden_size_, linear_before_reset_, Direction::kForward, @@ -400,8 +399,8 @@ Status DeepCpuGruOp::ComputeImpl(OpKernelContext& context) const { activation_funcs_.Entries()[1], clip_, ttp_); fw->Compute(input, sequence_lens_span, num_directions_, input_weights_1, recurrent_weights_1, output_1, hidden_output_1); -#ifndef USE_MKLDNN +#if defined(USE_MLAS) && !defined(USE_OPENMP) #ifndef USE_EIGEN_THREADPOOL } }; @@ -420,8 +419,7 @@ Status DeepCpuGruOp::ComputeImpl(OpKernelContext& context) const { cv.notify_one(); }); #endif // USE_EIGEN_THREADPOOL - -#endif // ! USE_MKLDNN +#endif // USE_MLAS && ! USE_OPENMP std::unique_ptr> bw = std::make_unique>( alloc, logger, @@ -432,15 +430,14 @@ Status DeepCpuGruOp::ComputeImpl(OpKernelContext& context) const { clip_, ttp_); bw->Compute(input, sequence_lens_span, num_directions_, input_weights_2, recurrent_weights_2, output_2, hidden_output_2); -#ifndef USE_MKLDNN +#if defined(USE_MLAS) && !defined(USE_OPENMP) #ifdef USE_EIGEN_THREADPOOL auto ul = std::unique_lock(lock); - if (!done) cv.wait(ul); + if (!done) cv.wait(ul); #else task_results_fw.get(); #endif - -#endif // ! USE_MKLDNN +#endif // USE_MLAS && ! USE_OPENMP } // namespace onnxruntime else { std::unique_ptr> gru_p = std::make_unique>(