-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update C++ to standard 20 for Windows #17706
base: main
Are you sure you want to change the base?
Conversation
@@ -55,7 +55,7 @@ class QnnBackendManager { | |||
~QnnBackendManager(); | |||
char* DlError() { | |||
#ifdef _WIN32 | |||
return ""; | |||
return nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest splitting this change out to a separated PR and ask the QNN EP team to review. Your this change probably won't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this related to returning a non-const char pointer to a string literal? can we just change the signature to const char* DlError()
? looks like the existing usage of QnnBackendManager::DlError()
should accomodate that.
@@ -65,7 +65,11 @@ void OStreamSink::SendImpl(const Timestamp& timestamp, const std::string& logger | |||
#ifdef _WIN32 | |||
void WOStreamSink::SendImpl(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) { | |||
// operator for formatting of timestamp in ISO8601 format including microseconds | |||
using date::operator<<; | |||
#if __cplusplus >= 202002L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use timestamp_ns::operator<<
here to reduce the ifdefs.
the ifdefs here will need to be updated to work for Windows:
onnxruntime/include/onnxruntime/core/common/logging/logging.h
Lines 61 to 68 in c5087b9
// TODO: When other compilers support std::chrono::operator<<, update this. | |
// TODO: Check support for other compilers' version before enable C++20 for other compilers. | |
// Xcode added support for C++20's std::chrono::operator<< in SDK version 14.4. | |
#if __cplusplus >= 202002L && __MAC_OS_X_VERSION_MAX_ALLOWED >= 140400L | |
namespace timestamp_ns = std::chrono; | |
#else | |
namespace timestamp_ns = ::date; | |
#endif |
@@ -193,6 +193,9 @@ void SetupUpsampleFilterAntiAlias(FilterParamsAntiAlias<T>& p, | |||
} | |||
|
|||
float total_weight_inv = total_weight == 0.0f ? 1.f : 1.0f / total_weight; | |||
#ifdef _WIN32 | |||
#pragma warning(disable : 4189) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is it warning about here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable.
depends on #21071 |
…n_c++20 # Conflicts: # onnxruntime/contrib_ops/cuda/math/cufft_plan_cache.h # orttraining/orttraining/training_ops/cuda/nn/conv_shared.h # orttraining/orttraining/training_ops/rocm/nn/conv_grad.cc
Description
Current blocker:
1. The date project from github is dead. It does not support c++20
2. C100 "Internal compiler error" from VC++ arm64 compiler
3. Not enough disk space on Windows CI pipeline
4. Chaning is_pod to is_trivial
Motivation and Context