Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
464dbef
[NNAPI EP] add uint8 support for Transpose/Concat/Maxpool, add suppor…
guoyu-wang Feb 3, 2021
c7feb48
Don't send out Runtime error telemetry when can't create LearningMode…
Feb 3, 2021
6cf54ff
Switch Android CI java build to JDK 11 (#6552)
guoyu-wang Feb 4, 2021
0d35f0e
[CoreML EP] Add support of Conv operator (#6510)
guoyu-wang Feb 4, 2021
aa31ba5
Merge CPU packaging pipelines (#6480)
Feb 4, 2021
2ef792a
Don't resolve symlink in resolve_executable_path(). (#6540)
edgchen1 Feb 4, 2021
318b82c
Cast Op performance fix. (#6509)
edgchen1 Feb 4, 2021
5fc377f
Partial updating of ROCM reduction code.
jessebenson Jan 13, 2021
c4b6559
Update reduction_all.cu
jessebenson Jan 13, 2021
554184b
Add reduce template parameters.
jessebenson Jan 14, 2021
4c1db50
miopen common
jessebenson Jan 14, 2021
1961329
Reuse CUDA's reduction_functions.cc
jessebenson Jan 15, 2021
a28ddb8
Reduction ops.
jessebenson Jan 15, 2021
0b14770
Update remaining reduction ops to use MIOpen. double datatype is not…
jessebenson Jan 15, 2021
21a47ec
Disable a couple more unsupported tests.
jessebenson Jan 15, 2021
5d87927
Code formatting.
jessebenson Jan 15, 2021
86ac11a
Delete ROCM-specific reduction code that is identical to CUDA reducti…
jessebenson Jan 19, 2021
76fcebd
Fix scratch buffer early free.
jessebenson Jan 21, 2021
a9e4d70
Fix merge conflict.
jessebenson Jan 26, 2021
3c44184
Pick up changes from:
jessebenson Feb 3, 2021
d914e29
Reuse reduction_functions.cu
jessebenson Feb 4, 2021
4e61e25
Update link in readme (#6537)
prasanthpul Feb 4, 2021
615acf1
remove keras example from python documentation (#6574)
xadupre Feb 5, 2021
89627a8
[Node.js binding] support NPM v7+ (#6559)
fs-eire Feb 5, 2021
c49d1db
Add type reduction support to Slice and Transpose (#6547)
skottmckay Feb 5, 2021
f14c621
Tile perf enhancements - continued (#6561)
hariharans29 Feb 5, 2021
c5d2538
Add more kernels that have typed registrations to the operators we tr…
skottmckay Feb 5, 2021
3b376da
Enable type reduction for Gather CPU kernel. (#6579)
edgchen1 Feb 5, 2021
f2ce3aa
add set_model_dir and update ONNX (#6119)
jcwchen Feb 5, 2021
68193e2
Let execution fall back to CPU EP if Compile of a partition on curren…
guoyu-wang Feb 5, 2021
973c391
OpenVino add build_shared_lib flag in the build command (#6560)
sfatimar Feb 5, 2021
299ace0
Support to allow user to specify compute stream per session (#3723)
weixingzhang Feb 5, 2021
82229c8
Support no bias in layernorm and skiplayernorm op (#6554)
wangyems Feb 6, 2021
b5bd14f
Update GPU packaging pipelines to cuda11 and fix the other build brea…
Feb 6, 2021
ccfd902
Remove condition from ORT_RETURN_IF[_NOT] macro output. (#6563)
skottmckay Feb 6, 2021
115e16b
ort_test_utils: skip creating input if it is an initializer (#6544)
jcwchen Feb 6, 2021
dda5a62
Fix updated Doxygen errors. (#6588)
yuslepukhin Feb 6, 2021
af9dfa7
Remove docs that have been migrated to https://onnxruntime.ai/docs (#…
natke Feb 6, 2021
b50b0a8
Fix build failure when building with --build_wheel on Windows
georgen117 Feb 2, 2021
b57a7f4
Delay load dxcore in winml model tests
Feb 5, 2021
dbe3136
Fix build.gradle so it always targets Java 8 class files.
Craigacp Feb 5, 2021
d18aa45
Enable more ROCM ops that are sharing CUDA code. Some are needed for…
jessebenson Feb 6, 2021
c86c21e
Generate error when an explicit stream argument is not provided in th…
weixingzhang Feb 6, 2021
190b90a
Fix some coding conventions issues (#6583)
skottmckay Feb 7, 2021
19c130f
Reduce CastMLFloat16ThroughFloat size (Scott's suggested changes), fi…
edgchen1 Feb 7, 2021
1dd920f
Fix TensorRT unnecessary file cache operations (#6601)
nietras Feb 8, 2021
67ef6b1
[Mult-GPU inferencing] Add new API to get/set device id. Set correct …
Feb 8, 2021
0b1e21c
Fix bug with ORT format serialization of tensor attributes. (#6602)
skottmckay Feb 8, 2021
13d7db9
Don't update the excluded ops/types unless args.update is true. Updat…
skottmckay Feb 8, 2021
16eed68
Fix layer_norm.cc on x86 (#6556)
Feb 9, 2021
c02ae61
Make kernel hash stable in type reduced build (#6603)
skottmckay Feb 9, 2021
56e4e47
Quantize model with QDQ format (#6541)
yufenglee Feb 9, 2021
6c5f50d
deprecate omp in ci
RandyShuai Feb 8, 2021
ff06330
enable omp for debug build
RandyShuai Feb 8, 2021
d3a2c8c
Support double for operators ReduceMax, ReduceMin (#6265)
xadupre Feb 9, 2021
0b89f93
Update CUDA build configs (#6598)
Feb 9, 2021
e9d0398
Add engine decryption in TensorRT EP (#6612)
stevenlix Feb 9, 2021
8f14b8b
Support disabling training kernels as part of a reduced build (#6557)
Feb 9, 2021
1c72774
Update a few WinML model test filters for DML
jstoecker Feb 9, 2021
e70344e
Fix training python packaging pipeline (#6613)
Feb 9, 2021
505c1f3
use == instead of is for python 3.8
yufenglee Feb 9, 2021
8f0b877
Enable running some ops on CUDA (#6572)
hariharans29 Feb 10, 2021
8972621
Generate shape-independent graph if any input dimension < 2 (#6581)
wschin Feb 10, 2021
b09bfc8
Revert "Remove abs in LpPool (#6303)"
hariharans29 Feb 10, 2021
88d4806
Log warning when GetGradientForOp() silently fails. (#6586)
Feb 10, 2021
8502573
fix CheckLearningModelPixelRange (#6632)
zhangxiang1993 Feb 10, 2021
eef9a7a
Update DirectML 1.4.0 to 1.4.1 for ORT 1.7 (#6636)
fdwr Feb 10, 2021
352e8cb
Move ORT_ENFORCE()'s within MLTypeCallDispatcher to helper class func…
edgchen1 Feb 10, 2021
e59cb94
Add CI build with type reduction enabled (#6622)
edgchen1 Feb 10, 2021
042964f
Change how ONNX get installed
Feb 10, 2021
d2ce8a2
Add hipFFT include directory (transitional step) before ROCm. (#5992)
memmett Feb 11, 2021
64edcad
[NNAPI EP] Add EP option to disable CPU (#6593)
guoyu-wang Feb 11, 2021
fd83e38
[CoreML EP] Add support of BatchNormalization/Reshape/Global[Average/…
guoyu-wang Feb 11, 2021
a7b6fc0
Support skiplayernorm fusion without beta in layernorm (#6617)
wangyems Feb 11, 2021
b4b829d
Update transformers tool based on latest transformers (#6641)
wangyems Feb 11, 2021
1c3168c
Skip constant folding dequantizelinear for quant qdq format (#6643)
yufenglee Feb 11, 2021
8378a45
Add python 3.8/3.9 support for Windows GPU and Linux ARM64 (#6615)
Feb 12, 2021
fba46a7
Update readme to reference docs webpage content (#6621)
faxu Feb 12, 2021
1916e35
Reduce tensorprotoutils binary size (#6634)
skottmckay Feb 12, 2021
ce01c37
Cleanup macros used to register activations. (#6628)
skottmckay Feb 12, 2021
950c941
Remove year from license (#6658)
faxu Feb 12, 2021
78e408d
Enable type reduction for ConstantOfShape CPU kernel. (#6594)
edgchen1 Feb 12, 2021
f11b5d3
[CoreML EP] Enable coreml for onnx_test_runner and onnxruntime_perf_t…
guoyu-wang Feb 12, 2021
e6de0eb
Add nightly pipeline for MI100 to run convergence and batch size test…
Feb 12, 2021
b2cddc5
Consolidate MLTypeCallDispatcher classes (#6651)
edgchen1 Feb 12, 2021
a07a14d
exclude non support types (#6653)
RandySheriffH Feb 12, 2021
87cb6fd
Add LearningModelBuilder to WinML Experimental Namespace along with v…
smk2007 Feb 12, 2021
dd50c39
Change Linux python packaging pipeline compile flags (#6668)
Feb 12, 2021
25f7c93
Require explicit inclusion of custom op support in a minimal build (#…
skottmckay Feb 13, 2021
72eb5de
Add Python 3.9 to pypi metadata
faxu Feb 13, 2021
df3d6ba
Deprecate OMP from Python package (#6610)
RandySheriffH Feb 13, 2021
f649f91
[OpenVINO-EP] Enabling OpenVINO Runtime options for Perftest applicat…
MaajidKhan Feb 14, 2021
a35b30e
Change BuildKernelDefConstraintsFunctorFromTypeList struct to BuildKe…
edgchen1 Feb 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ Note that OpenVINO is built as a [shared provider library](#Execution-Provider-S

##### Windows
```
.\build.bat --config RelWithDebInfo --use_openvino <hardware_option>
.\build.bat --config RelWithDebInfo --use_openvino <hardware_option> --build_shared_lib
```
*Note: The default Windows CMake Generator is Visual Studio 2017, but you can also use the newer Visual Studio 2019 by passing `--cmake_generator "Visual Studio 16 2019"` to `.\build.bat`*

##### Linux
```
./build.sh --config RelWithDebInfo --use_openvino <hardware_option>
./build.sh --config RelWithDebInfo --use_openvino <hardware_option> --build_shared_lib
```

<code>--use_openvino</code>: Builds the OpenVINO Execution Provider in ONNX Runtime.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Microsoft Corporation
Copyright (c) Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
243 changes: 27 additions & 216 deletions README.md

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2168,38 +2168,6 @@ See the [community structure document](http://docs.tvm.ai/contribute/community.h

_____

jemalloc

Unless otherwise specified, files in the jemalloc source distribution are
subject to the following license:
--------------------------------------------------------------------------------
Copyright (C) 2002-2018 Jason Evans <[email protected]>.
All rights reserved.
Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved.
Copyright (C) 2009-2018 Facebook, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice(s),
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice(s),
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------

_____

FreeBSD: getopt.c file

Copyright (c) 1987, 1993, 1994
Expand Down
9 changes: 0 additions & 9 deletions cgmanifests/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@
}
}
},
{
"component": {
"type": "git",
"git": {
"commitHash": "e02b83cc5e3c4d30f93dba945162e3aa58d962d6",
"repositoryUrl": "https://github.com/jemalloc/jemalloc.git"
}
}
},
{
"component": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion cgmanifests/submodules/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
"component": {
"type": "git",
"git": {
"commitHash": "174de7d086a768cba29374a56a7461eff87cfdb3",
"commitHash": "237926eab41de21fb9addc4b03b751fd6a3343ec",
"repositoryUrl": "https://github.com/onnx/onnx"
},
"comments": "git submodule at cmake/external/onnx"
Expand Down
179 changes: 107 additions & 72 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ option(onnxruntime_ENABLE_MEMLEAK_CHECKER "Experimental: Enable memory leak chec
option(onnxruntime_USE_CUDA "Build with CUDA support" OFF)
option(onnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO "When building with CUDA support, generate device code line number information." OFF)
option(onnxruntime_USE_OPENVINO "Build with OpenVINO support" OFF)
option(onnxruntime_USE_EIGEN_FOR_BLAS "Use eign for blas" ON)
option(onnxruntime_USE_COREML "Build with CoreML support" OFF)
option(onnxruntime_USE_NNAPI_BUILTIN "Build with builtin NNAPI lib for Android NNAPI support" OFF)
option(onnxruntime_USE_RKNPU "Build with RKNPU support" OFF)
Expand Down Expand Up @@ -124,6 +123,7 @@ option(onnxruntime_DISABLE_RTTI "Disable RTTI" OFF)
option(onnxruntime_DISABLE_EXCEPTIONS "Disable exception handling. Requires onnxruntime_MINIMAL_BUILD currently." OFF)
option(onnxruntime_MINIMAL_BUILD "Exclude as much as possible from the build. Support ORT format models. No support for ONNX format models." OFF)
option(onnxruntime_EXTENDED_MINIMAL_BUILD "onnxruntime_MINIMAL_BUILD with support for execution providers that compile kernels." OFF)
option(onnxruntime_MINIMAL_BUILD_CUSTOM_OPS "Add custom operator kernels support to a minimal build." OFF)
option(onnxruntime_REDUCED_OPS_BUILD "Reduced set of kernels are registered in build via modification of the kernel registration source files." OFF)
option(onnxruntime_DISABLE_ORT_FORMAT_LOAD "Disable loading an ORT format model when onnxruntime_MINIMAL_BUILD=OFF (i.e. in a full build)." OFF)

Expand Down Expand Up @@ -161,6 +161,10 @@ if(onnxruntime_USE_VALGRIND AND NOT WIN32)
add_definitions(-DRE2_ON_VALGRIND=1)
endif()

if(WIN32)
string(APPEND CMAKE_CXX_FLAGS " /W3")
endif()

if (onnxruntime_ENABLE_NVTX_PROFILE)
add_definitions(-DENABLE_NVTX_PROFILE=1)
endif()
Expand Down Expand Up @@ -233,6 +237,10 @@ if (onnxruntime_MINIMAL_BUILD)
add_compile_definitions(ORT_EXTENDED_MINIMAL_BUILD)
endif()

if (onnxruntime_MINIMAL_BUILD_CUSTOM_OPS)
add_compile_definitions(ORT_MINIMAL_BUILD_CUSTOM_OPS)
endif()

set(onnxruntime_REDUCED_OPS_BUILD ON)

if (NOT onnxruntime_ENABLE_PYTHON)
Expand Down Expand Up @@ -643,18 +651,6 @@ if (onnxruntime_USE_CUDA AND "${onnxruntime_CUDNN_HOME}" STREQUAL "")
message(FATAL_ERROR "onnxruntime_CUDNN_HOME required for onnxruntime_USE_CUDA")
endif()

if (onnxruntime_USE_EIGEN_FOR_BLAS)
add_definitions(-DUSE_EIGEN_FOR_BLAS)
endif()

if (onnxruntime_USE_OPENBLAS AND "${onnxruntime_OPENBLAS_HOME}" STREQUAL "" AND WIN32)
# On linux we assume blas is installed via 'apt-get install libopenblas-dev'
message(FATAL_ERROR "onnxruntime_OPENBLAS_HOME required for onnxruntime_USE_OPENBLAS")
endif()

if (onnxruntime_USE_OPENBLAS AND onnxruntime_USE_EIGEN_FOR_BLAS)
message(FATAL_ERROR "use one of onnxruntime_USE_OPENBLAS, onnxruntime_USE_EIGEN_FOR_BLAS")
endif()

get_filename_component(ONNXRUNTIME_ROOT "${ONNXRUNTIME_ROOT}" ABSOLUTE)
get_filename_component(ORTTRAINING_ROOT "${ORTTRAINING_ROOT}" ABSOLUTE)
Expand Down Expand Up @@ -701,11 +697,81 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DGSL_UNENFORCED_O

include(eigen)

#onnxruntime_EXTERNAL_LIBRARIES could contain onnx, onnx_proto,libprotobuf, cuda/cudnn, jemalloc,
# dnnl/mklml, openblas, onnxruntime_codegen_tvm, tvm, nnvm_compiler and pthread
#onnxruntime_EXTERNAL_LIBRARIES could contain onnx, onnx_proto,libprotobuf, cuda/cudnn,
# dnnl/mklml, onnxruntime_codegen_tvm, tvm, nnvm_compiler and pthread
# pthread is always at the last
set(onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto ${PROTOBUF_LIB} re2::re2)


set(onnxruntime_LINK_DIRS )
if(onnxruntime_USE_CUDA)
#TODO: combine onnxruntime_CUDNN_HOME and onnxruntime_CUDA_HOME, assume they are the same
if (WIN32)
list(APPEND onnxruntime_LINK_DIRS ${onnxruntime_CUDNN_HOME}/lib/x64 ${onnxruntime_CUDA_HOME}/x64/lib64)
else()
list(APPEND onnxruntime_LINK_DIRS ${onnxruntime_CUDNN_HOME}/lib64 ${onnxruntime_CUDA_HOME}/lib64)
endif()
endif()

function(onnxruntime_add_shared_library target_name)
add_library(${target_name} SHARED ${ARGN})
target_link_directories(${target_name} PRIVATE ${onnxruntime_LINK_DIRS})
if (MSVC)
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /utf-8>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>")
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /sdl>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/sdl>")
set_target_properties(${target_name} PROPERTIES VS_CA_EXCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
else()
target_compile_definitions(${target_name} PUBLIC -DNSYNC_ATOMIC_CPP11)
target_include_directories(${target_name} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/nsync/public")
endif()
target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT})
if(onnxruntime_ENABLE_LTO)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE)
endif()
endfunction()

#For plugins that are not linked into other targets but may be loaded dynamically at runtime using dlopen-like functionality.
function(onnxruntime_add_shared_library_module target_name)
add_library(${target_name} MODULE ${ARGN})
target_link_directories(${target_name} PRIVATE ${onnxruntime_LINK_DIRS})
if (MSVC)
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /utf-8>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>")
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /sdl>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/sdl>")
set_target_properties(${target_name} PROPERTIES VS_CA_EXCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
else()
target_compile_definitions(${target_name} PUBLIC -DNSYNC_ATOMIC_CPP11)
target_include_directories(${target_name} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/nsync/public")
endif()
target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT})
if(onnxruntime_ENABLE_LTO)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE)
endif()
endfunction()

#almost the same as the above function, except the first line of the body
function(onnxruntime_add_executable target_name)
add_executable(${target_name} ${ARGN})
target_link_directories(${target_name} PRIVATE ${onnxruntime_LINK_DIRS})
if (MSVC)
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /utf-8>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>")
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /sdl>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/sdl>")
set_target_properties(${target_name} PROPERTIES VS_CA_EXCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
else()
target_compile_definitions(${target_name} PUBLIC -DNSYNC_ATOMIC_CPP11)
target_include_directories(${target_name} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/nsync/public")
endif()
target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT})
if(onnxruntime_ENABLE_LTO)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
set_target_properties(${target_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE)
endif()
endfunction()

function(onnxruntime_add_include_to_target dst_target)
foreach(src_target ${ARGN})
target_include_directories(${dst_target} PRIVATE $<TARGET_PROPERTY:${src_target},INTERFACE_INCLUDE_DIRECTORIES>)
Expand Down Expand Up @@ -890,6 +956,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Android" AND Onnxruntime_GCOV_COVERAGE)
string(APPEND CMAKE_C_FLAGS " -g -O0 --coverage ")
endif()

set(ORT_WARNING_FLAGS )
#Adjust warning flags
if (WIN32)
add_definitions(-DPLATFORM_WINDOWS -DNOGDI -DNOMINMAX -D_USE_MATH_DEFINES)
Expand All @@ -898,27 +965,30 @@ if (WIN32)
endif()
# parallel build
# These compiler opitions cannot be forwarded to NVCC, so cannot use add_compiler_options
string(APPEND CMAKE_CXX_FLAGS " /MP /W4")
string(APPEND CMAKE_C_FLAGS " /MP /W4")
string(APPEND CMAKE_CXX_FLAGS " /MP")
if(onnxruntime_USE_CUDA)
list(APPEND ORT_WARNING_FLAGS "/W3")
else()
list(APPEND ORT_WARNING_FLAGS "/W4")
endif()
#Compiler bug, we should get such warnings. It will be fixed in a new VC release
string(APPEND CMAKE_CXX_FLAGS " /wd4127")
list(APPEND ORT_WARNING_FLAGS "/wd4127")
# class needs to have dll-interface to be used by clients
string(APPEND CMAKE_CXX_FLAGS " /wd4251")
list(APPEND ORT_WARNING_FLAGS "/wd4251")
# issued by thrust nonstandard extension used: nameless struct/union
string(APPEND CMAKE_CXX_FLAGS " /wd4201")
list(APPEND ORT_WARNING_FLAGS "/wd4201")
if (onnxruntime_ENABLE_STATIC_ANALYSIS)
string(APPEND CMAKE_CXX_FLAGS
" /analyze:stacksize 131072"
# disable warning because there are many occurrences from test macros
" /wd6326 " # potential comparison of a constant with another constant
)
list(APPEND ORT_WARNING_FLAGS "/analyze:stacksize 131072")
list(APPEND ORT_WARNING_FLAGS "/wd6326") # potential comparison of a constant with another constant
if(onnxruntime_USE_OPENMP)
list(APPEND ORT_WARNING_FLAGS "/wd6993") # Code analysis ignores OpenMP constructs
endif()
endif()

# Treat warning as error if onnxruntime_DEV_MODE is ON
# For cross-compiled ARM64 binaries, there are too many warnings to fix, hence ignore warnings for now
if (onnxruntime_DEV_MODE AND NOT CMAKE_CROSSCOMPILING)
# treat warnings as errors
string(APPEND CMAKE_CXX_FLAGS " /WX")
list(APPEND ORT_WARNING_FLAGS "/WX")
foreach(type EXE STATIC SHARED)
set(CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS} /WX")
endforeach()
Expand Down Expand Up @@ -946,6 +1016,10 @@ if (WIN32)
endif()
endforeach()
endif()
foreach(ORT_FLAG ${ORT_WARNING_FLAGS})
string(APPEND CMAKE_CXX_FLAGS " ${ORT_FLAG}")
string(APPEND CMAKE_C_FLAGS " ${ORT_FLAG}")
endforeach()
else()
add_definitions(-DPLATFORM_POSIX)
# Enable warning and enable space optimization in Linux
Expand Down Expand Up @@ -991,19 +1065,6 @@ else()
endif()
endif()
set(onnxruntime_DELAYLOAD_FLAGS "")
if (onnxruntime_USE_JEMALLOC)
if (onnxruntime_USE_MIMALLOC_STL_ALLOCATOR OR onnxruntime_USE_MIMALLOC_ARENA_ALLOCATOR)
message( FATAL_ERROR "You cannot specify both jemalloc and mimalloc." )
endif()

if (Win32)
message( FATAL_ERROR "Jemalloc is not supported on Windows." )
endif()
include(jemalloc)
add_definitions(-DUSE_JEMALLOC=1)
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${JEMALLOC_STATIC_LIBRARIES})
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES jemalloc)
endif()

include_directories(
${ONNXRUNTIME_INCLUDE_DIR}
Expand Down Expand Up @@ -1087,17 +1148,6 @@ if (onnxruntime_USE_VITISAI)
endif()
endif()

if (onnxruntime_USE_OPENBLAS)
add_definitions(-DUSE_OPENBLAS=1)
if (WIN32)
include_directories(${onnxruntime_OPENBLAS_HOME})
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_OPENBLAS_HOME}/lib/libopenblas.lib)
else()
# on linux we assume blas is installed via 'apt-get install libopenblas-dev'
list(APPEND onnxruntime_EXTERNAL_LIBRARIES openblas)
endif()
endif()

configure_file(onnxruntime_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime_config.h)

if (onnxruntime_USE_CUDA)
Expand Down Expand Up @@ -1129,25 +1179,6 @@ if (onnxruntime_USE_CUDA)
list(APPEND ONNXRUNTIME_CUDA_LIBRARIES cublas cudnn curand cufft)
endif()

# CUDA_HOME and CUDNN_HOME may differ, so need to add both to the link directories
if (WIN32)
link_directories(${onnxruntime_CUDA_HOME}/lib/x64)
link_directories(${onnxruntime_CUDNN_HOME}/lib/x64)

# delayload causes crash on exit, so disable for now
# please update cudaDelayLoadedLibs in Microsoft.ML.OnnxRuntime/SessionOptions.cs if you change delayload
#file(GLOB cuda_dll_paths "${onnxruntime_CUDA_HOME}/bin/cublas64_*" "${onnxruntime_CUDA_HOME}/bin/cudart64_*" "${onnxruntime_CUDA_HOME}/bin/curand64_*" "${onnxruntime_CUDA_HOME}/bin/cufft64_*")
#set(onnxruntime_DELAYLOAD_FLAGS "${onnxruntime_DELAYLOAD_FLAGS} /DELAYLOAD:cudnn64_8.dll")
#foreach(cuda_dll_path ${cuda_dll_paths})
# get_filename_component(cuda_dll_file_name ${cuda_dll_path} NAME)
# set(onnxruntime_DELAYLOAD_FLAGS "${onnxruntime_DELAYLOAD_FLAGS} /DELAYLOAD:${cuda_dll_file_name}")
#endforeach(cuda_dll_path)

else()
link_directories(${onnxruntime_CUDA_HOME}/lib64)
link_directories(${onnxruntime_CUDNN_HOME}/lib64)
endif()

list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${ONNXRUNTIME_CUDA_LIBRARIES})
if(NOT CMAKE_CUDA_ARCHITECTURES)
if(CMAKE_LIBRARY_ARCHITECTURE STREQUAL "aarch64-linux-gnu")
Expand All @@ -1172,9 +1203,12 @@ if (onnxruntime_USE_CUDA)
endif()
endif()
endif()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr --default-stream legacy")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --Werror default-stream-launch")
endif()
if (NOT WIN32)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --expt-relaxed-constexpr --compiler-options -fPIC")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --compiler-options -fPIC")
endif()
# Options passed to cudafe
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcudafe \"--diag_suppress=bad_friend_decl\"")
Expand Down Expand Up @@ -1368,6 +1402,7 @@ foreach(target_name onnxruntime_common onnxruntime_graph onnxruntime_framework o
if (MSVC)
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /utf-8>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>")
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /sdl>" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/sdl>")
set_target_properties(${target_name} PROPERTIES VS_CA_EXCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
else()
target_compile_definitions(${target_name} PUBLIC -DNSYNC_ATOMIC_CPP11)
target_include_directories(${target_name} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/external/nsync/public")
Expand Down
14 changes: 0 additions & 14 deletions cmake/ConfigureVisualStudioCodeAnalysis.props

This file was deleted.

Loading