diff --git a/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc b/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc index 7f3451f00dcb9..ed19da9196d58 100644 --- a/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc +++ b/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc @@ -87,7 +87,11 @@ Status EmbedLayerNorm::Compute(OpKernelContext* context) const { int n = batch_size * sequence_length; concurrency::ThreadPool::TryBatchParallelFor( +#if __cplusplus >= 202002L context->GetOperatorThreadPool(), n, [=, this, &failed](ptrdiff_t index) { +#else + context->GetOperatorThreadPool(), n, [=, &failed](ptrdiff_t index) { +#endif int word_col_index = input_ids_data[index]; if (word_col_index < 0 || word_col_index >= word_embedding_length) { failed.store(true, std::memory_order_release); diff --git a/onnxruntime/core/providers/cpu/text/string_normalizer.cc b/onnxruntime/core/providers/cpu/text/string_normalizer.cc index 0ae5de8a3f336..6bda1b5c479ed 100644 --- a/onnxruntime/core/providers/cpu/text/string_normalizer.cc +++ b/onnxruntime/core/providers/cpu/text/string_normalizer.cc @@ -220,12 +220,12 @@ class Utf8ConverterGeneric { } private: -#if defined(__GNUC__) && __cplusplus >= 202002L +#if __cplusplus >= 202002L #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif std::codecvt_utf8 converter_; -#if defined(__GNUC__) && __cplusplus >= 202002L +#if __cplusplus >= 202002L #pragma GCC diagnostic pop #endif };