Skip to content

Commit

Permalink
#if __cplusplus >= 202002L
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Jun 20, 2024
1 parent cc3f411 commit 84122a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ Status EmbedLayerNorm<T>::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);
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/cpu/text/string_normalizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<wchar_t> converter_;
#if defined(__GNUC__) && __cplusplus >= 202002L
#if __cplusplus >= 202002L
#pragma GCC diagnostic pop
#endif
};
Expand Down

0 comments on commit 84122a5

Please sign in to comment.