Skip to content

Commit

Permalink
if(UNIX)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Jul 22, 2024
1 parent 254c8c1 commit 7386423
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include(FetchContent)
include(CheckFunctionExists)

# TODO: update this once all system adapt c++20
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(UNIX)
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 17)
Expand Down
11 changes: 3 additions & 8 deletions onnxruntime/core/session/inference_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2745,15 +2745,10 @@ common::Status InferenceSession::RunAsync(const RunOptions* run_options,
if (!tp || concurrency::ThreadPool::DegreeOfParallelism(tp) < 2) {
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT, "intra op thread pool must have at least one thread for RunAsync");
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
std::function<void()> run_fn = [=]() {
#pragma GCC diagnostic pop
#if __cplusplus >= 202002L

Check warning on line 2748 in onnxruntime/core/session/inference_session.cc

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: onnxruntime/core/session/inference_session.cc:2748: Lines should be <= 120 characters long [whitespace/line_length] [2]
std::function<void()> run_fn = [=, this]() {
#else
#ifdef __cplusplus >= 202002L
std::function<void()> run_fn = [=, this]() {
#endif
std::function<void()> run_fn = [=]() {
#endif
Status status = Status::OK();
ORT_TRY {
Expand Down

0 comments on commit 7386423

Please sign in to comment.