From e03b8a1e2ff92da1d8d3a20fe7279d31437f409b Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Wed, 18 Mar 2020 11:53:46 -0700 Subject: [PATCH] Move path_lib from onnxruntime/core/framework to onnxruntime/core/platform. (#3253) Moved path_lib.h/cc from onnxruntime/core/framework to onnxruntime/core/platform and from the onnxruntime_framework to the onnxruntime_common libraries. --- cmake/onnxruntime_common.cmake | 2 ++ cmake/onnxruntime_unittests.cmake | 2 +- onnxruntime/core/framework/session_state_initializer.h | 2 +- onnxruntime/core/framework/tensor_external_data_info.cc | 2 +- onnxruntime/core/framework/tensorprotoutils.cc | 2 +- onnxruntime/core/{framework => platform}/path_lib.cc | 2 +- onnxruntime/core/{framework => platform}/path_lib.h | 0 onnxruntime/test/onnx/TestCase.cc | 2 +- onnxruntime/test/onnx/TestCase.h | 2 +- onnxruntime/test/onnx/main.cc | 2 +- onnxruntime/test/onnx/microbenchmark/modeltest.cc | 2 +- onnxruntime/test/onnx/runner.cc | 2 +- onnxruntime/test/perftest/command_args_parser.cc | 2 +- onnxruntime/test/{framework => platform}/path_lib_test.cc | 6 ++++-- onnxruntime/test/providers/memcpy_test.cc | 2 +- 15 files changed, 18 insertions(+), 14 deletions(-) rename onnxruntime/core/{framework => platform}/path_lib.cc (98%) rename onnxruntime/core/{framework => platform}/path_lib.h (100%) rename onnxruntime/test/{framework => platform}/path_lib_test.cc (91%) diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake index 36362387b0..c6567524bb 100644 --- a/cmake/onnxruntime_common.cmake +++ b/cmake/onnxruntime_common.cmake @@ -16,6 +16,8 @@ set(onnxruntime_common_src_patterns "${ONNXRUNTIME_ROOT}/core/platform/env.cc" "${ONNXRUNTIME_ROOT}/core/platform/env_time.h" "${ONNXRUNTIME_ROOT}/core/platform/env_time.cc" + "${ONNXRUNTIME_ROOT}/core/platform/path_lib.h" + "${ONNXRUNTIME_ROOT}/core/platform/path_lib.cc" "${ONNXRUNTIME_ROOT}/core/platform/scoped_resource.h" "${ONNXRUNTIME_ROOT}/core/platform/telemetry.h" "${ONNXRUNTIME_ROOT}/core/platform/telemetry.cc" diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index c5afa1690c..b32d55357a 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -602,7 +602,7 @@ endif() file(GLOB onnxruntime_perf_test_src CONFIGURE_DEPENDS ${onnxruntime_perf_test_src_patterns} ) -add_executable(onnxruntime_perf_test ${onnxruntime_perf_test_src} ${ONNXRUNTIME_ROOT}/core/framework/path_lib.cc) +add_executable(onnxruntime_perf_test ${onnxruntime_perf_test_src} ${ONNXRUNTIME_ROOT}/core/platform/path_lib.cc) if(MSVC) target_compile_options(onnxruntime_perf_test PRIVATE "$<$:SHELL:--compiler-options /utf-8>" "$<$>:/utf-8>") endif() diff --git a/onnxruntime/core/framework/session_state_initializer.h b/onnxruntime/core/framework/session_state_initializer.h index d2053ab6a0..13618d84c7 100644 --- a/onnxruntime/core/framework/session_state_initializer.h +++ b/onnxruntime/core/framework/session_state_initializer.h @@ -7,9 +7,9 @@ #include "core/common/const_pointer_container.h" #include "core/framework/allocator.h" #include "core/framework/tensor.h" -#include "core/framework/path_lib.h" #include "core/framework/tensor_allocator.h" #include "core/framework/session_options.h" +#include "core/platform/path_lib.h" namespace onnxruntime { class ExecutionProviders; diff --git a/onnxruntime/core/framework/tensor_external_data_info.cc b/onnxruntime/core/framework/tensor_external_data_info.cc index 16879d3c96..3448aaf283 100644 --- a/onnxruntime/core/framework/tensor_external_data_info.cc +++ b/onnxruntime/core/framework/tensor_external_data_info.cc @@ -3,7 +3,7 @@ #include "tensor_external_data_info.h" #include "core/common/common.h" -#include "path_lib.h" +#include "core/platform/path_lib.h" #ifdef _WIN32 #include diff --git a/onnxruntime/core/framework/tensorprotoutils.cc b/onnxruntime/core/framework/tensorprotoutils.cc index ae05e95cd1..ca295fc5b2 100644 --- a/onnxruntime/core/framework/tensorprotoutils.cc +++ b/onnxruntime/core/framework/tensorprotoutils.cc @@ -17,7 +17,7 @@ #include "core/framework/allocator.h" #include "core/framework/callback.h" #include "core/framework/data_types.h" -#include "core/framework/path_lib.h" +#include "core/platform/path_lib.h" #include "core/session/ort_apis.h" using namespace ONNX_NAMESPACE; diff --git a/onnxruntime/core/framework/path_lib.cc b/onnxruntime/core/platform/path_lib.cc similarity index 98% rename from onnxruntime/core/framework/path_lib.cc rename to onnxruntime/core/platform/path_lib.cc index f34deb9025..0ee2cff506 100644 --- a/onnxruntime/core/framework/path_lib.cc +++ b/onnxruntime/core/platform/path_lib.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "path_lib.h" +#include "core/platform/path_lib.h" #include "core/common/status.h" #include "core/common/common.h" #include diff --git a/onnxruntime/core/framework/path_lib.h b/onnxruntime/core/platform/path_lib.h similarity index 100% rename from onnxruntime/core/framework/path_lib.h rename to onnxruntime/core/platform/path_lib.h diff --git a/onnxruntime/test/onnx/TestCase.cc b/onnxruntime/test/onnx/TestCase.cc index 10af011a92..96fb654ffe 100644 --- a/onnxruntime/test/onnx/TestCase.cc +++ b/onnxruntime/test/onnx/TestCase.cc @@ -12,8 +12,8 @@ #include "core/common/common.h" #include "core/platform/env.h" #include "core/platform/ort_mutex.h" +#include "core/platform/path_lib.h" #include "core/session/onnxruntime_cxx_api.h" -#include "core/framework/path_lib.h" #include "core/framework/allocator.h" #include "re2/re2.h" #include diff --git a/onnxruntime/test/onnx/TestCase.h b/onnxruntime/test/onnx/TestCase.h index 66663a0450..f6f61248e0 100644 --- a/onnxruntime/test/onnx/TestCase.h +++ b/onnxruntime/test/onnx/TestCase.h @@ -7,8 +7,8 @@ #include #include #include +#include #include -#include #include "heap_buffer.h" namespace ONNX_NAMESPACE { diff --git a/onnxruntime/test/onnx/main.cc b/onnxruntime/test/onnx/main.cc index ff586ec2db..5fa7f0e8ff 100644 --- a/onnxruntime/test/onnx/main.cc +++ b/onnxruntime/test/onnx/main.cc @@ -17,7 +17,7 @@ #include "sync_api.h" #include "providers.h" #include -#include "core/framework/path_lib.h" +#include "core/platform/path_lib.h" #include "core/session/onnxruntime_cxx_api.h" #include "core/optimizer/graph_transformer_level.h" #include "core/framework/session_options.h" diff --git a/onnxruntime/test/onnx/microbenchmark/modeltest.cc b/onnxruntime/test/onnx/microbenchmark/modeltest.cc index 138013c2e3..d1e344fd0f 100644 --- a/onnxruntime/test/onnx/microbenchmark/modeltest.cc +++ b/onnxruntime/test/onnx/microbenchmark/modeltest.cc @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/onnxruntime/test/onnx/runner.cc b/onnxruntime/test/onnx/runner.cc index dc9435ab24..4bde15b4f8 100644 --- a/onnxruntime/test/onnx/runner.cc +++ b/onnxruntime/test/onnx/runner.cc @@ -11,7 +11,7 @@ #include #include #include "test_allocator.h" -#include +#include #ifdef _WIN32 #include #else diff --git a/onnxruntime/test/perftest/command_args_parser.cc b/onnxruntime/test/perftest/command_args_parser.cc index 78846e089d..e071c93b4b 100644 --- a/onnxruntime/test/perftest/command_args_parser.cc +++ b/onnxruntime/test/perftest/command_args_parser.cc @@ -15,7 +15,7 @@ #endif #include -#include +#include #include #include "test_configuration.h" diff --git a/onnxruntime/test/framework/path_lib_test.cc b/onnxruntime/test/platform/path_lib_test.cc similarity index 91% rename from onnxruntime/test/framework/path_lib_test.cc rename to onnxruntime/test/platform/path_lib_test.cc index 58e6320cdd..d1417fe7e6 100644 --- a/onnxruntime/test/framework/path_lib_test.cc +++ b/onnxruntime/test/platform/path_lib_test.cc @@ -1,7 +1,9 @@ -#include "test_utils.h" +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#include "core/platform/path_lib.h" #include "gtest/gtest.h" -#include "core/framework/path_lib.h" #include #define PATH_EXPECT(X, Y) \ diff --git a/onnxruntime/test/providers/memcpy_test.cc b/onnxruntime/test/providers/memcpy_test.cc index 42b0e23c1c..96e6747a30 100644 --- a/onnxruntime/test/providers/memcpy_test.cc +++ b/onnxruntime/test/providers/memcpy_test.cc @@ -10,7 +10,7 @@ #include "core/framework/op_kernel.h" #include "core/framework/session_state.h" #include "core/framework/utils.h" -#include "core/framework/path_lib.h" +#include "core/platform/path_lib.h" #include #include "test/test_environment.h"