Skip to content
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

Incremental updates. #4

Merged
merged 1 commit into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
path = cmake/external/googletest
url = https://github.com/google/googletest.git
[submodule "cmake/external/onnx"]
path = cmake/external/onnx
url = https://github.com/onnx/onnx
path = cmake/external/onnx
url = https://github.com/onnx/onnx
[submodule "cmake/external/tvm"]
path = cmake/external/tvm
url = https://github.com/dmlc/tvm.git
Expand All @@ -16,6 +16,3 @@
[submodule "cmake/external/gsl"]
path = cmake/external/gsl
url = https://github.com/Microsoft/GSL.git
[submodule "cmake/external/protobuf"]
path = cmake/external/protobuf
url = https://github.com/google/protobuf.git
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# ONNX Runtime

[![Build
Status](https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/Microsoft.onnxruntime)](https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=1)

ONNX Runtime is the runtime for [ONNX](https://github.com/onnx/onnx).

# Engineering Design
[Engineering Design](docs/HighLevelDesign.md)

# Install
## Python
* https://pypi.org/project/onnxruntime/
* https://pypi.org/project/onnxruntime-gpu/

## Windows
TODO

## Linux
TODO

# Sample API usage
* [Sample Usage](onnxruntime/test/shared_lib/fns_candy_style_transfer.c)
* [API Documentation](docs/C_API.md)
# API
| API | CPU package | GPU package |
|-----|-------------|-------------|
| [Python](https://docs.microsoft.com/en-us/python/api/overview/azure/onnx/intro?view=azure-onnx-py) | [Windows](TODO)<br>[Linux](https://pypi.org/project/onnxruntime/)<br>[Mac](TODO)| [Windows](TODO)<br>[Linux](https://pypi.org/project/onnxruntime/) |
| [C#](docs/CSharp_API.md) | [Windows](TODO)| [Windows](TODO) |
| [C](docs/C_API.md) | [Windows](TODO)<br>[Linux](TODO) | |

# Build
[Build](BUILD.md)
Expand Down
2 changes: 1 addition & 1 deletion VERSION_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.3
2 changes: 1 addition & 1 deletion cmake/external/onnx
Submodule onnx updated 79 files
+1 −1 .circleci/config.yml
+3 −5 .travis/before_install.sh
+2 −2 .travis/install.sh
+5 −5 .travis/script.sh
+1 −0 CMakeLists.txt
+1 −1 README.md
+3 −3 appveyor.yml
+1 −1 docs/CONTRIBUTING.md
+205 −5 docs/Changelog.md
+398 −5 docs/Operators.md
+180 −1 docs/TestCoverage.md
+31 −0 onnx/backend/test/case/node/acosh.py
+31 −0 onnx/backend/test/case/node/asinh.py
+31 −0 onnx/backend/test/case/node/atanh.py
+31 −0 onnx/backend/test/case/node/cosh.py
+64 −0 onnx/backend/test/case/node/onehot.py
+31 −0 onnx/backend/test/case/node/sinh.py
+12 −6 onnx/backend/test/cpp/driver_test.cc
+14 −0 onnx/backend/test/data/node/test_acosh/model.onnx
+ onnx/backend/test/data/node/test_acosh/test_data_set_0/input_0.pb
+1 −0 onnx/backend/test/data/node/test_acosh/test_data_set_0/output_0.pb
+11 −0 onnx/backend/test/data/node/test_acosh_example/model.onnx
+ onnx/backend/test/data/node/test_acosh_example/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_acosh_example/test_data_set_0/output_0.pb
+14 −0 onnx/backend/test/data/node/test_asinh/model.onnx
+1 −0 onnx/backend/test/data/node/test_asinh/test_data_set_0/input_0.pb
+1 −0 onnx/backend/test/data/node/test_asinh/test_data_set_0/output_0.pb
+11 −0 onnx/backend/test/data/node/test_asinh_example/model.onnx
+ onnx/backend/test/data/node/test_asinh_example/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_asinh_example/test_data_set_0/output_0.pb
+14 −0 onnx/backend/test/data/node/test_atanh/model.onnx
+1 −0 onnx/backend/test/data/node/test_atanh/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_atanh/test_data_set_0/output_0.pb
+11 −0 onnx/backend/test/data/node/test_atanh_example/model.onnx
+ onnx/backend/test/data/node/test_atanh_example/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_atanh_example/test_data_set_0/output_0.pb
+13 −0 onnx/backend/test/data/node/test_cosh/model.onnx
+1 −0 onnx/backend/test/data/node/test_cosh/test_data_set_0/input_0.pb
+1 −0 onnx/backend/test/data/node/test_cosh/test_data_set_0/output_0.pb
+11 −0 onnx/backend/test/data/node/test_cosh_example/model.onnx
+ onnx/backend/test/data/node/test_cosh_example/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_cosh_example/test_data_set_0/output_0.pb
+24 −0 onnx/backend/test/data/node/test_onehot_with_axis/model.onnx
+ onnx/backend/test/data/node/test_onehot_with_axis/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_onehot_with_axis/test_data_set_0/input_1.pb
+ onnx/backend/test/data/node/test_onehot_with_axis/test_data_set_0/input_2.pb
+ onnx/backend/test/data/node/test_onehot_with_axis/test_data_set_0/output_0.pb
+21 −0 onnx/backend/test/data/node/test_onehot_without_axis/model.onnx
+ onnx/backend/test/data/node/test_onehot_without_axis/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_onehot_without_axis/test_data_set_0/input_1.pb
+ onnx/backend/test/data/node/test_onehot_without_axis/test_data_set_0/input_2.pb
+ onnx/backend/test/data/node/test_onehot_without_axis/test_data_set_0/output_0.pb
+13 −0 onnx/backend/test/data/node/test_sinh/model.onnx
+1 −0 onnx/backend/test/data/node/test_sinh/test_data_set_0/input_0.pb
+1 −0 onnx/backend/test/data/node/test_sinh/test_data_set_0/output_0.pb
+11 −0 onnx/backend/test/data/node/test_sinh_example/model.onnx
+ onnx/backend/test/data/node/test_sinh_example/test_data_set_0/input_0.pb
+ onnx/backend/test/data/node/test_sinh_example/test_data_set_0/output_0.pb
+16 −6 onnx/checker.cc
+3 −1 onnx/cpp2py_export.cc
+123 −6 onnx/defs/controlflow/defs.cc
+13 −1 onnx/defs/data_type_utils.cc
+8 −2 onnx/defs/gen_doc.py
+110 −0 onnx/defs/math/defs.cc
+13 −0 onnx/defs/operator_sets.h
+43 −17 onnx/defs/schema.cc
+24 −7 onnx/defs/schema.h
+44 −1 onnx/defs/shape_inference.h
+140 −0 onnx/defs/tensor/defs.cc
+5 −0 onnx/helper.py
+9 −0 onnx/onnx-ml.proto
+9 −0 onnx/onnx-ml.proto3
+10 −1 onnx/onnx.in.proto
+2 −0 onnx/onnx_cpp2py_export/defs.pyi
+16 −5 onnx/shape_inference/implementation.cc
+5 −0 onnx/test/helper_test.py
+55 −6 onnx/test/shape_inference_test.py
+1 −1 setup.cfg
+1 −1 setup.py
6 changes: 3 additions & 3 deletions cmake/onnxruntime_csharp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# Licensed under the MIT License.

set (CSHARP_ROOT ${PROJECT_SOURCE_DIR}/../csharp)
set (CSHARP_MASTER_TARGET Microsoft.ML.OnnxRuntime)
set (CSHARP_MASTER_PROJECT "${CSHARP_ROOT}/OnnxRuntime/OnnxRuntime.csproj" )
set (CSHARP_MASTER_TARGET OnnxRuntime.CSharp)
set (CSHARP_MASTER_PROJECT ${CSHARP_ROOT}/OnnxRuntime.CSharp.proj )
include(CSharpUtilities)

include_external_msproject(${CSHARP_MASTER_TARGET}
"${CSHARP_MASTER_PROJECT}"
${CSHARP_MASTER_PROJECT}
onnxruntime # make it depend on the native onnxruntime project
)
17 changes: 9 additions & 8 deletions cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(mlas_common_srcs
${ONNXRUNTIME_ROOT}/core/mlas/lib/platform.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/sgemm.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/convolve.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/pooling.cpp
${ONNXRUNTIME_ROOT}/core/mlas/lib/bias.cpp
)

Expand Down Expand Up @@ -97,26 +98,26 @@ else()
# instruction set extension and explicitly set the compiler flag as appropriate.

set(mlas_platform_srcs_sse2
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelSse2.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmTransposePackB16x4Sse2.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelSse2.S
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmTransposePackB16x4Sse2.S
)
set_source_files_properties(${mlas_platform_srcs_sse} PROPERTIES COMPILE_FLAGS "-msse2")

set(mlas_platform_srcs_avx
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelAvx.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelM1Avx.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelM1TransposeBAvx.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmTransposePackB16x4Avx.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelAvx.S
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelM1Avx.S
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelM1TransposeBAvx.S
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmTransposePackB16x4Avx.S
)
set_source_files_properties(${mlas_platform_srcs_avx} PROPERTIES COMPILE_FLAGS "-mavx")

set(mlas_platform_srcs_avx2
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelFma3.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelFma3.S
)
set_source_files_properties(${mlas_platform_srcs_avx2} PROPERTIES COMPILE_FLAGS "-mavx2 -mfma")

set(mlas_platform_srcs_avx512f
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelAvx512F.s
${ONNXRUNTIME_ROOT}/core/mlas/lib/x86_64/SgemmKernelAvx512F.S
)
set_source_files_properties(${mlas_platform_srcs_avx512f} PROPERTIES COMPILE_FLAGS "-mavx512f")

Expand Down
10 changes: 8 additions & 2 deletions cmake/onnxruntime_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ target_compile_options(onnxruntime_pybind11_state PRIVATE "-Wno-cast-function-ty
endif()
target_include_directories(onnxruntime_pybind11_state PRIVATE ${ONNXRUNTIME_ROOT} ${PYTHON_INCLUDE_DIR} ${NUMPY_INCLUDE_DIR})
target_include_directories(onnxruntime_pybind11_state PRIVATE ${pybind11_INCLUDE_DIRS})
if(UNIX)
if(APPLE)
set(ONNXRUNTIME_SO_LINK_FLAG "-Xlinker -exported_symbols_list ${ONNXRUNTIME_ROOT}/python/exported_symbols.lst")
elseif(UNIX)
set(ONNXRUNTIME_SO_LINK_FLAG "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/python/version_script.lds -Xlinker --no-undefined")
endif()

Expand Down Expand Up @@ -75,7 +77,11 @@ if (MSVC)
target_link_libraries(onnxruntime_pybind11_state ${onnxruntime_pybind11_state_libs} ${onnxruntime_EXTERNAL_LIBRARIES} ${PYTHON_LIBRARY_RELEASE} ${ONNXRUNTIME_SO_LINK_FLAG})
else()
target_link_libraries(onnxruntime_pybind11_state ${onnxruntime_pybind11_state_libs} ${onnxruntime_EXTERNAL_LIBRARIES} ${PYTHON_LIBRARY} ${ONNXRUNTIME_SO_LINK_FLAG})
set_target_properties(onnxruntime_pybind11_state PROPERTIES LINK_FLAGS "-Xlinker -rpath=\$ORIGIN")
if (APPLE)
set_target_properties(onnxruntime_pybind11_state PROPERTIES INSTALL_RPATH "@loader_path")
else()
set_target_properties(onnxruntime_pybind11_state PROPERTIES LINK_FLAGS "-Xlinker -rpath=\$ORIGIN")
endif()
endif()

set_target_properties(onnxruntime_pybind11_state PROPERTIES PREFIX "")
Expand Down
68 changes: 40 additions & 28 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ function(AddTest)
)
endfunction(AddTest)

#Check whether C++17 header file <filesystem> is present
include(CheckIncludeFiles)
check_include_files("filesystem" HAS_FILESYSTEM_H LANGUAGE CXX)
check_include_files("experimental/filesystem" HAS_EXPERIMENTAL_FILESYSTEM_H LANGUAGE CXX)

#Do not add '${TEST_SRC_DIR}/util/include' to your include directories directly
#Use onnxruntime_add_include_to_target or target_link_libraries, so that compile definitions
#can propagate correctly.
Expand Down Expand Up @@ -158,7 +163,7 @@ endif()

if(WIN32)
list(APPEND onnxruntime_test_framework_libs Advapi32)
else()
elseif(HAS_FILESYSTEM_H OR HAS_EXPERIMENTAL_FILESYSTEM_H)
list(APPEND onnxruntime_test_framework_libs stdc++fs)
endif()

Expand All @@ -176,8 +181,8 @@ if(onnxruntime_USE_MKLDNN)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_mkldnn)
endif()

if( NOT WIN32)
list(APPEND onnxruntime_test_providers_libs stdc++fs)
if( NOT WIN32 AND (HAS_FILESYSTEM_H OR HAS_EXPERIMENTAL_FILESYSTEM_H))
list(APPEND onnxruntime_test_providers_libs stdc++fs)
endif()

file(GLOB_RECURSE onnxruntime_test_tvm_src
Expand Down Expand Up @@ -316,7 +321,7 @@ add_custom_command(

add_library(onnx_test_data_proto ${TEST_SRC_DIR}/proto/tml.proto)
if(HAS_NULL_DEREFERENCE)
target_compile_options(onnx_test_data_proto PRIVATE "-Wno-null-dereference")
target_compile_options(onnx_test_data_proto PRIVATE "-Wno-null-dereference")
endif()
if(WIN32)
target_compile_options(onnx_test_data_proto PRIVATE "/wd4125" "/wd4456")
Expand Down Expand Up @@ -362,7 +367,9 @@ if(WIN32)
set(GETOPT_LIB win_getopt_mb)
else()
set(onnx_test_runner_common_srcs ${onnx_test_runner_common_srcs} ${onnx_test_runner_src_dir}/onnxruntime_event.h ${onnx_test_runner_src_dir}/simple_thread_pool.h ${onnx_test_runner_src_dir}/sync_api_linux.cc)
set(FS_STDLIB stdc++fs)
if(HAS_FILESYSTEM_H OR HAS_EXPERIMENTAL_FILESYSTEM_H)
set(FS_STDLIB stdc++fs)
endif()
endif()

add_library(onnx_test_runner_common ${onnx_test_runner_common_srcs})
Expand Down Expand Up @@ -436,7 +443,7 @@ install(TARGETS onnx_test_runner
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

if(onnxruntime_BUILD_BENCHMARKS)
if(onnxruntime_BUILD_BENCHMARKS AND (HAS_FILESYSTEM_H OR HAS_EXPERIMENTAL_FILESYSTEM_H))
add_executable(onnxruntime_benchmark ${TEST_SRC_DIR}/onnx/microbenchmark/main.cc ${TEST_SRC_DIR}/onnx/microbenchmark/modeltest.cc)
target_include_directories(onnxruntime_benchmark PRIVATE ${ONNXRUNTIME_ROOT} ${onnxruntime_graph_header} benchmark)
target_compile_options(onnxruntime_benchmark PRIVATE "/wd4141")
Expand All @@ -449,7 +456,6 @@ if(WIN32)
set(DISABLED_WARNINGS_FOR_PROTOBUF "/wd4125" "/wd4456" "/wd4505")
target_compile_options(onnx_test_runner_common PRIVATE ${DISABLED_WARNINGS_FOR_PROTOBUF} -D_CRT_SECURE_NO_WARNINGS)
target_compile_options(onnx_test_runner PRIVATE ${DISABLED_WARNINGS_FOR_PROTOBUF})
#Maybe "CMAKE_SYSTEM_PROCESSOR" is better
endif()

set(onnxruntime_exec_src_dir ${TEST_SRC_DIR}/onnxruntime_exec)
Expand All @@ -471,31 +477,33 @@ add_test(NAME onnx_test_pytorch_converted
add_test(NAME onnx_test_pytorch_operator
COMMAND onnx_test_runner ${PROJECT_SOURCE_DIR}/external/onnx/onnx/backend/test/data/pytorch-operator)

set(onnxruntime_perf_test_src_dir ${TEST_SRC_DIR}/perftest)
set(onnxruntime_perf_test_src_patterns
"${onnxruntime_perf_test_src_dir}/*.cc"
"${onnxruntime_perf_test_src_dir}/*.h")
if(HAS_FILESYSTEM_H OR HAS_EXPERIMENTAL_FILESYSTEM_H)
set(onnxruntime_perf_test_src_dir ${TEST_SRC_DIR}/perftest)
set(onnxruntime_perf_test_src_patterns
"${onnxruntime_perf_test_src_dir}/*.cc"
"${onnxruntime_perf_test_src_dir}/*.h")

if(WIN32)
list(APPEND onnxruntime_perf_test_src_patterns
"${onnxruntime_perf_test_src_dir}/windows/*.cc"
"${onnxruntime_perf_test_src_dir}/windows/*.h" )
else ()
list(APPEND onnxruntime_perf_test_src_patterns
"${onnxruntime_perf_test_src_dir}/posix/*.cc"
"${onnxruntime_perf_test_src_dir}/posix/*.h" )
endif()
if(WIN32)
list(APPEND onnxruntime_perf_test_src_patterns
"${onnxruntime_perf_test_src_dir}/windows/*.cc"
"${onnxruntime_perf_test_src_dir}/windows/*.h" )
else ()
list(APPEND onnxruntime_perf_test_src_patterns
"${onnxruntime_perf_test_src_dir}/posix/*.cc"
"${onnxruntime_perf_test_src_dir}/posix/*.h" )
endif()

file(GLOB onnxruntime_perf_test_src ${onnxruntime_perf_test_src_patterns})
add_executable(onnxruntime_perf_test ${onnxruntime_perf_test_src})
file(GLOB onnxruntime_perf_test_src ${onnxruntime_perf_test_src_patterns})
add_executable(onnxruntime_perf_test ${onnxruntime_perf_test_src})

target_include_directories(onnxruntime_perf_test PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} ${extra_includes} ${onnxruntime_graph_header} ${onnxruntime_exec_src_dir} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/onnx)
if (WIN32)
target_compile_options(onnxruntime_perf_test PRIVATE ${disabled_warnings})
endif()
target_include_directories(onnxruntime_perf_test PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} ${extra_includes} ${onnxruntime_graph_header} ${onnxruntime_exec_src_dir} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/onnx)
if (WIN32)
target_compile_options(onnxruntime_perf_test PRIVATE ${disabled_warnings})
endif()

target_link_libraries(onnxruntime_perf_test PRIVATE ${onnx_test_libs} ${GETOPT_LIB})
set_target_properties(onnxruntime_perf_test PROPERTIES FOLDER "ONNXRuntimeTest")
target_link_libraries(onnxruntime_perf_test PRIVATE ${onnx_test_libs} ${GETOPT_LIB})
set_target_properties(onnxruntime_perf_test PROPERTIES FOLDER "ONNXRuntimeTest")
endif()

# shared lib
if (onnxruntime_BUILD_SHARED_LIB)
Expand Down Expand Up @@ -549,3 +557,7 @@ add_executable(onnxruntime_mlas_test ${TEST_SRC_DIR}/mlas/unittest.cpp)
target_include_directories(onnxruntime_mlas_test PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc)
target_link_libraries(onnxruntime_mlas_test PRIVATE onnxruntime_mlas)
set_target_properties(onnxruntime_mlas_test PROPERTIES FOLDER "ONNXRuntimeTest")

if (onnxruntime_ENABLE_MICROSOFT_INTERNAL)
include(onnxruntime_standalone_tests_internal.cmake)
endif()
7 changes: 7 additions & 0 deletions csharp/Nuget.CSharp.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NuGetOrg" value="https://api.nuget.org/v3/index.json" />
</packageSources>

</configuration>
49 changes: 49 additions & 0 deletions csharp/OnnxRuntime.CSharp.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This is the master msbuild project file for all csharp components.
This is created so that the NuGet dependencies are restored before the projects are built during a CI build.
CMake creates a target to this project
-->

<Project DefaultTargets="Build">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

<Target Name="RestoreProjects" BeforeTargets="Build">
<Message Importance="High" Text="Restoring NuGet packages for CSharp projects..." />
<MSBuild Projects="src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj"
Targets="Restore"
Properties="RestoreConfigFile=$(MSBuildThisFileDirectory)\NuGet.CSharp.config;MSBuildWarningsAsMessages=NU1503;RestoreIgnoreFailedSource=true"
/>
<MSBuild Projects="sample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj"
Targets="Restore"
Properties="RestoreConfigFile=$(MSBuildThisFileDirectory)\NuGet.CSharp.config;MSBuildWarningsAsMessages=NU1503;RestoreIgnoreFailedSource=true"
/>
<MSBuild Projects="test\Microsoft.ML.OnnxRuntime.Tests\Microsoft.ML.OnnxRuntime.Tests.csproj"
Targets="Restore"
Properties="RestoreConfigFile=$(MSBuildThisFileDirectory)\NuGet.CSharp.config;MSBuildWarningsAsMessages=NU1503;RestoreIgnoreFailedSource=true"
/>
</Target>

<Target Name="Build">
<Message Importance="High" Text="Building CSharp projects..." />

<MSBuild Projects="src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj"
Targets="Build" />
<MSBuild Projects="sample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj"
Targets="Build" />
<MSBuild Projects="test\Microsoft.ML.OnnxRuntime.Tests\Microsoft.ML.OnnxRuntime.Tests.csproj"
Targets="Build" />

</Target>

<Target Name="RunTest" AfterTargets="Build">
<Message Importance="High" Text="Running CSharp tests..." />
<Exec Command="dotnet test test\Microsoft.ML.OnnxRuntime.Tests\Microsoft.ML.OnnxRuntime.Tests.csproj -c $(Configuration) --no-build" />
</Target>
</Project>
37 changes: 37 additions & 0 deletions csharp/OnnxRuntime.CSharp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2003
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime", "src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj", "{584B53B3-359D-4DC2-BCD8-530B5D4685AD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample", "sample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj", "{1AA14958-9246-4163-9403-F650E65ADCBC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests", "test\Microsoft.ML.OnnxRuntime.Tests\Microsoft.ML.OnnxRuntime.Tests.csproj", "{50173D13-DF29-42E7-A30B-8B12D36C77B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|Any CPU.Build.0 = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AA14958-9246-4163-9403-F650E65ADCBC}.Release|Any CPU.Build.0 = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3DBDA2B-F169-4EDE-9353-858904124B75}
EndGlobalSection
EndGlobal
Loading