From 802d96556e8ad2f6684bad47c7c0d76c70cd74c6 Mon Sep 17 00:00:00 2001 From: "Shah Asaduzzaman (ASAD)" Date: Thu, 18 Jul 2019 21:43:18 -0700 Subject: [PATCH 1/5] copy cpu and cude provider factory headers. move the headers under path structure, which is ugly --- ...-artifacts-package-and-publish-steps-windows.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/c-api-artifacts-package-and-publish-steps-windows.yml b/tools/ci_build/github/azure-pipelines/templates/c-api-artifacts-package-and-publish-steps-windows.yml index 807e6246f78c7..c0698703658d8 100644 --- a/tools/ci_build/github/azure-pipelines/templates/c-api-artifacts-package-and-publish-steps-windows.yml +++ b/tools/ci_build/github/azure-pipelines/templates/c-api-artifacts-package-and-publish-steps-windows.yml @@ -12,11 +12,22 @@ steps: mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}} mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\lib mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include + mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime + mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core + mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\session + + mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\providers + mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\providers\cpu + mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\providers\cuda + echo "Directories created" copy $(Build.BinariesDirectory)\${{parameters.buildConfig}}\${{parameters.buildConfig}}\onnxruntime.dll $(Build.BinariesDirectory)\${{parameters.artifactName}}\lib copy $(Build.BinariesDirectory)\${{parameters.buildConfig}}\${{parameters.buildConfig}}\onnxruntime.pdb $(Build.BinariesDirectory)\${{parameters.artifactName}}\lib copy $(Build.BinariesDirectory)\${{parameters.buildConfig}}\${{parameters.buildConfig}}\onnxruntime.lib $(Build.BinariesDirectory)\${{parameters.artifactName}}\lib - copy $(Build.SourcesDirectory)\include\onnxruntime\core\session\onnxruntime_*.h $(Build.BinariesDirectory)\${{parameters.artifactName}}\include + copy $(Build.SourcesDirectory)\include\onnxruntime\core\session\onnxruntime_*.h $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\session + copy $(Build.SourcesDirectory)\include\onnxruntime\core\providers\cpu\cpu_provider_factory.h $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\providers\cpu + copy $(Build.SourcesDirectory)\include\onnxruntime\core\providers\cuda\cuda_provider_factory.h $(Build.BinariesDirectory)\${{parameters.artifactName}}\include\onnxruntime\core\providers\cuda + # copy the README, licence and TPN copy $(Build.SourcesDirectory)\README.md $(Build.BinariesDirectory)\${{parameters.artifactName}}\README.md copy $(Build.SourcesDirectory)\docs\C_API.md $(Build.BinariesDirectory)\${{parameters.artifactName}}\C_API.md From 849affacc103f0b4f65294330844c6c9d3776bb6 Mon Sep 17 00:00:00 2001 From: "Shah Asaduzzaman (ASAD)" Date: Mon, 22 Jul 2019 12:52:46 -0700 Subject: [PATCH 2/5] moved provider factories to the same location as the root c_api header. Package them in the root include folder --- .../Microsoft.ML.OnnxRuntime.csproj | 12 ++++++++++++ .../cpu => session}/cpu_provider_factory.h | 2 +- .../cuda => session}/cuda_provider_factory.h | 2 +- .../mkldnn => session}/mkldnn_provider_factory.h | 2 +- .../ngraph => session}/ngraph_provider_factory.h | 2 +- .../nnapi => session}/nnapi_provider_factory.h | 2 +- .../openvino_provider_factory.h | 2 +- .../tensorrt_provider_factory.h | 2 +- ...-artifacts-package-and-publish-steps-windows.yml | 13 +++---------- tools/ci_build/github/linux/copy_strip_binary.sh | 3 +++ 10 files changed, 25 insertions(+), 17 deletions(-) rename include/onnxruntime/core/{providers/cpu => session}/cpu_provider_factory.h (88%) rename include/onnxruntime/core/{providers/cuda => session}/cuda_provider_factory.h (88%) rename include/onnxruntime/core/{providers/mkldnn => session}/mkldnn_provider_factory.h (88%) rename include/onnxruntime/core/{providers/ngraph => session}/ngraph_provider_factory.h (88%) rename include/onnxruntime/core/{providers/nnapi => session}/nnapi_provider_factory.h (82%) rename include/onnxruntime/core/{providers/openvino => session}/openvino_provider_factory.h (88%) rename include/onnxruntime/core/{providers/tensorrt => session}/tensorrt_provider_factory.h (85%) diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj index bffa46e623c56..11ddc53899d0e 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj +++ b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj @@ -46,6 +46,18 @@ CopyToOutputDirectory="Never" Visible="false" /> + + Date: Mon, 22 Jul 2019 13:33:54 -0700 Subject: [PATCH 3/5] keep the provider factory headers in the original place --- .../Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj | 4 ++-- .../core/{session => providers/cpu}/cpu_provider_factory.h | 0 .../core/{session => providers/cuda}/cuda_provider_factory.h | 0 .../{session => providers/mkldnn}/mkldnn_provider_factory.h | 0 .../{session => providers/ngraph}/ngraph_provider_factory.h | 0 .../{session => providers/nnapi}/nnapi_provider_factory.h | 0 .../openvino}/openvino_provider_factory.h | 0 .../tensorrt}/tensorrt_provider_factory.h | 0 .../c-api-artifacts-package-and-publish-steps-windows.yml | 4 ++-- tools/ci_build/github/linux/copy_strip_binary.sh | 4 ++-- 10 files changed, 6 insertions(+), 6 deletions(-) rename include/onnxruntime/core/{session => providers/cpu}/cpu_provider_factory.h (100%) rename include/onnxruntime/core/{session => providers/cuda}/cuda_provider_factory.h (100%) rename include/onnxruntime/core/{session => providers/mkldnn}/mkldnn_provider_factory.h (100%) rename include/onnxruntime/core/{session => providers/ngraph}/ngraph_provider_factory.h (100%) rename include/onnxruntime/core/{session => providers/nnapi}/nnapi_provider_factory.h (100%) rename include/onnxruntime/core/{session => providers/openvino}/openvino_provider_factory.h (100%) rename include/onnxruntime/core/{session => providers/tensorrt}/tensorrt_provider_factory.h (100%) diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj index 11ddc53899d0e..f7fbdcda281be 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj +++ b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj @@ -46,13 +46,13 @@ CopyToOutputDirectory="Never" Visible="false" /> - - Date: Mon, 22 Jul 2019 14:49:22 -0700 Subject: [PATCH 4/5] add session to include path --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 139889a48d56c..c1911c9941e86 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -298,7 +298,7 @@ endif() get_filename_component(ONNXRUNTIME_ROOT "${ONNXRUNTIME_ROOT}" ABSOLUTE) get_filename_component(REPO_ROOT "${REPO_ROOT}" ABSOLUTE) -set(ONNXRUNTIME_INCLUDE_DIR ${REPO_ROOT}/include/onnxruntime) +set(ONNXRUNTIME_INCLUDE_DIR ${REPO_ROOT}/include/onnxruntime ${REPO_ROOT}/include/onnxruntime/core/session) add_subdirectory(external/date EXCLUDE_FROM_ALL) add_subdirectory(external/gsl EXCLUDE_FROM_ALL) From 75c76e8b9895b7baa35c073aae2d5a22cbfce8c9 Mon Sep 17 00:00:00 2001 From: "Shah Asaduzzaman (ASAD)" Date: Mon, 22 Jul 2019 15:29:54 -0700 Subject: [PATCH 5/5] update cmakelists.txt --- cmake/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c1911c9941e86..fae8402c4ed6a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -298,7 +298,7 @@ endif() get_filename_component(ONNXRUNTIME_ROOT "${ONNXRUNTIME_ROOT}" ABSOLUTE) get_filename_component(REPO_ROOT "${REPO_ROOT}" ABSOLUTE) -set(ONNXRUNTIME_INCLUDE_DIR ${REPO_ROOT}/include/onnxruntime ${REPO_ROOT}/include/onnxruntime/core/session) +set(ONNXRUNTIME_INCLUDE_DIR ${REPO_ROOT}/include/onnxruntime) add_subdirectory(external/date EXCLUDE_FROM_ALL) add_subdirectory(external/gsl EXCLUDE_FROM_ALL) @@ -470,7 +470,10 @@ if (onnxruntime_USE_JEMALLOC) list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES jemalloc) endif() -include_directories(${ONNXRUNTIME_INCLUDE_DIR}) +include_directories( + ${ONNXRUNTIME_INCLUDE_DIR} + ${REPO_ROOT}/include/onnxruntime/core/session +) if (onnxruntime_USE_MKLDNN OR onnxruntime_USE_MKLML) include(mkldnn)