From 15efa97252d6935b4c1ec4078a4aad5e7d541443 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 3 Jun 2024 19:37:05 -0400 Subject: [PATCH] Deprecate date with std::chrono --- cmake/deps.txt | 1 - include/onnxruntime/core/common/logging/logging.h | 11 ----------- .../core/platform/posix/logging/syslog_sink.cc | 1 - onnxruntime/core/platform/windows/logging/etw_sink.h | 1 - onnxruntime/test/util/include/capturing_sink.h | 2 -- 5 files changed, 16 deletions(-) diff --git a/cmake/deps.txt b/cmake/deps.txt index d4d19dea08c8b..888923a9d8997 100644 --- a/cmake/deps.txt +++ b/cmake/deps.txt @@ -15,7 +15,6 @@ abseil_cpp;https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.0.zip;bc2cec6baaad67fcb6c0c38972b687d4797927e9 coremltools;https://github.com/apple/coremltools/archive/refs/tags/7.1.zip;f1bab0f30966f2e217d8e01207d518f230a1641a cxxopts;https://github.com/jarro2783/cxxopts/archive/3c73d91c0b04e2b59462f0a741be8c07024c1bc0.zip;6c6ca7f8480b26c8d00476e0e24b7184717fe4f0 -date;https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.zip;2dac0c81dc54ebdd8f8d073a75c053b04b56e159 dlpack;https://github.com/dmlc/dlpack/archive/refs/tags/v0.6.zip;4d565dd2e5b31321e5549591d78aa7f377173445 # This Eigen commit id matches the eigen archive being consumed from https://gitlab.com/libeigen/eigen/-/archive/3.4/eigen-3.4.zip # prior to the 3.4.1 RC changing the bits and invalidating the hash. diff --git a/include/onnxruntime/core/common/logging/logging.h b/include/onnxruntime/core/common/logging/logging.h index f62053a5e44ab..7b833c6a751de 100644 --- a/include/onnxruntime/core/common/logging/logging.h +++ b/include/onnxruntime/core/common/logging/logging.h @@ -16,10 +16,6 @@ #include "core/common/logging/capture.h" #include "core/common/logging/severity.h" -#include "core/common/logging/macros.h" - -#include "date/date.h" - /* Logging overview and expected usage: @@ -58,14 +54,7 @@ namespace logging { using Timestamp = std::chrono::time_point; -// 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 #ifndef NDEBUG ORT_ATTRIBUTE_UNUSED static bool vlog_enabled = true; // Set directly based on your needs. diff --git a/onnxruntime/core/platform/posix/logging/syslog_sink.cc b/onnxruntime/core/platform/posix/logging/syslog_sink.cc index 9fbd26f093498..5a14fe1e0beb7 100644 --- a/onnxruntime/core/platform/posix/logging/syslog_sink.cc +++ b/onnxruntime/core/platform/posix/logging/syslog_sink.cc @@ -4,7 +4,6 @@ #include "core/common/logging/logging.h" #include "core/common/logging/capture.h" #include "syslog_sink.h" -#include "date/date.h" namespace onnxruntime { namespace logging { diff --git a/onnxruntime/core/platform/windows/logging/etw_sink.h b/onnxruntime/core/platform/windows/logging/etw_sink.h index 143c3fcfdfc52..1baded0eeb53b 100644 --- a/onnxruntime/core/platform/windows/logging/etw_sink.h +++ b/onnxruntime/core/platform/windows/logging/etw_sink.h @@ -16,7 +16,6 @@ #ifdef ETW_TRACE_LOGGING_SUPPORTED -#include #include #include #include diff --git a/onnxruntime/test/util/include/capturing_sink.h b/onnxruntime/test/util/include/capturing_sink.h index 39788947602df..17616064749bf 100644 --- a/onnxruntime/test/util/include/capturing_sink.h +++ b/onnxruntime/test/util/include/capturing_sink.h @@ -6,8 +6,6 @@ #include "core/common/logging/logging.h" #include "core/common/logging/isink.h" -#include "date/date.h" - namespace onnxruntime { namespace test {