Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into user/dwayner/DML1.8…
Browse files Browse the repository at this point in the history
…forORT1.10
  • Loading branch information
fdwr committed Nov 19, 2021
2 parents e0ffc30 + afd60a2 commit 22f650b
Show file tree
Hide file tree
Showing 120 changed files with 6,081 additions and 2,721 deletions.
22 changes: 7 additions & 15 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ option(onnxruntime_USE_ROCM "Build with AMD GPU support" OFF)
option(onnxruntime_DISABLE_CONTRIB_OPS "Disable contrib ops" OFF)
option(onnxruntime_DISABLE_ML_OPS "Disable traditional ML ops" OFF)
option(onnxruntime_DISABLE_SPARSE_TENSORS "Disable sparse tensors data types" OFF)
option(onnxruntime_DISABLE_OPTIONAL_TYPE "Disable optional type" OFF)
option(onnxruntime_MINIMAL_BUILD "Exclude as much as possible from the build. Support ORT format models. No support for ONNX format models." OFF)
cmake_dependent_option(onnxruntime_DISABLE_RTTI "Disable RTTI" ON "NOT onnxruntime_ENABLE_PYTHON" OFF)
# For now onnxruntime_DISABLE_EXCEPTIONS will only work with onnxruntime_MINIMAL_BUILD, more changes (ONNX, non-CPU EP, ...) are required to run this standalone
Expand Down Expand Up @@ -647,16 +648,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "iOSCross")
#For ios compliance
message("Adding flags for ios builds")
if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -target arm64-apple-darwin-macho")
elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "arm")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -target armv7a-apple-darwin-macho")
endif()
endif()

#Dependencies begin
if (onnxruntime_BUILD_UNIT_TESTS)
if (onnxruntime_PREFER_SYSTEM_LIB)
Expand Down Expand Up @@ -817,6 +808,10 @@ if (onnxruntime_DISABLE_SPARSE_TENSORS)
add_compile_definitions(DISABLE_SPARSE_TENSORS)
endif()

if (onnxruntime_DISABLE_OPTIONAL_TYPE)
add_compile_definitions(DISABLE_OPTIONAL_TYPE)
endif()

if (onnxruntime_USE_CUDA AND "${onnxruntime_CUDNN_HOME}" STREQUAL "")
message(FATAL_ERROR "onnxruntime_CUDNN_HOME required for onnxruntime_USE_CUDA")
endif()
Expand Down Expand Up @@ -1216,7 +1211,7 @@ 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)
if ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR (${CMAKE_SYSTEM_NAME} MATCHES "iOSCross") OR (${CMAKE_SYSTEM_NAME} MATCHES "iOS"))
if ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR (${CMAKE_SYSTEM_NAME} MATCHES "iOS"))
add_library(${target_name} SHARED ${ARGN})
else()
#On Windows, this target shouldn't generate an import lib, but I don't know how to disable it.
Expand All @@ -1229,10 +1224,7 @@ function(onnxruntime_add_shared_library_module target_name)
endif()
endfunction()

function(onnxruntime_add_executable target_name)
if (${CMAKE_SYSTEM_NAME} MATCHES "iOSCross")
message(FATAL_ERROR "iOS doesn't support commmand line tool")
endif()
function(onnxruntime_add_executable target_name)
add_executable(${target_name} ${ARGN})
onnxruntime_configure_target(${target_name})
if (onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_BUILD_WEBASSEMBLY)
Expand Down
3 changes: 3 additions & 0 deletions cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ onnxruntime_add_static_library(onnxruntime_mlas
${MLAS_SRC_DIR}/qlmul.cpp
${MLAS_SRC_DIR}/qpostprocessor.cpp
${MLAS_SRC_DIR}/qlgavgpool.cpp
${MLAS_SRC_DIR}/qdwconv_kernelsize.cpp
)

set(ONNXRUNTIME_MLAS_LIBS onnxruntime_mlas)
Expand All @@ -46,6 +47,7 @@ function(setup_mlas_source_for_windows)

set(mlas_platform_preprocess_srcs
${MLAS_SRC_DIR}/arm64/DepthwiseConvsymKernelNeon.asm
${MLAS_SRC_DIR}/arm64/DepthwiseQConvKernelSize9Neon.asm
${MLAS_SRC_DIR}/arm64/QgemmU8X8KernelNeon.asm
${MLAS_SRC_DIR}/arm64/QgemmS8S8KernelNeon.asm
${MLAS_SRC_DIR}/arm64/QgemmU8X8KernelUdot.asm
Expand Down Expand Up @@ -265,6 +267,7 @@ else()
enable_language(ASM)
set(mlas_platform_srcs
${MLAS_SRC_DIR}/aarch64/DepthwiseConvSymKernelNeon.S
${MLAS_SRC_DIR}/aarch64/DepthwiseQConvKernelSize9Neon.S
${MLAS_SRC_DIR}/aarch64/QgemmU8X8KernelNeon.S
${MLAS_SRC_DIR}/aarch64/QgemmS8S8KernelNeon.S
${MLAS_SRC_DIR}/aarch64/QgemmU8X8KernelUdot.S
Expand Down
4 changes: 4 additions & 0 deletions docs/OperatorKernels.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ Do not modify directly.*
|QuantizeLinear|*in* x:**T1**<br> *in* y_scale:**tensor(float)**<br> *in* y_zero_point:**T2**<br> *out* y:**T2**|10+|**T1** = tensor(float)<br/> **T2** = tensor(int8), tensor(uint8)|
|RNN|*in* X:**T**<br> *in* W:**T**<br> *in* R:**T**<br> *in* B:**T**<br> *in* sequence_lens:**T1**<br> *in* initial_h:**T**<br> *out* Y:**T**<br> *out* Y_h:**T**|14+|**T** = tensor(double), tensor(float), tensor(float16)<br/> **T1** = tensor(int32)|
|||[7, 13]|**T** = tensor(double), tensor(float), tensor(float16)<br/> **T1** = tensor(int32)|
|RandomNormal|*out* output:**T**|1+|**T** = tensor(double), tensor(float), tensor(float16)|
|RandomNormalLike|*in* input:**T1**<br> *out* output:**T2**|1+|**T1** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)<br/> **T2** = tensor(double), tensor(float), tensor(float16)|
|RandomUniform|*out* output:**T**|1+|**T** = tensor(double), tensor(float), tensor(float16)|
|RandomUniformLike|*in* input:**T1**<br> *out* output:**T2**|1+|**T1** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)<br/> **T2** = tensor(double), tensor(float), tensor(float16)|
|Range|*in* start:**T**<br> *in* limit:**T**<br> *in* delta:**T**<br> *out* output:**T**|11+|**T** = tensor(double), tensor(float), tensor(int16), tensor(int32), tensor(int64)|
|Reciprocal|*in* X:**T**<br> *out* Y:**T**|13+|**T** = tensor(double), tensor(float), tensor(float16)|
|||[6, 12]|**T** = tensor(double), tensor(float), tensor(float16)|
Expand Down
16 changes: 8 additions & 8 deletions include/onnxruntime/core/common/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ enum StatusCode {
EP_FAIL = 11
};

inline const char* StatusCodeToString(StatusCode status) noexcept {
constexpr const char* StatusCodeToString(StatusCode status) noexcept {
switch (status) {
case StatusCode::OK:
return "SUCCESS";
Expand Down Expand Up @@ -79,7 +79,7 @@ inline const char* StatusCodeToString(StatusCode status) noexcept {
}

#ifdef _WIN32
inline HRESULT StatusCodeToHRESULT(StatusCode status) noexcept {
constexpr HRESULT StatusCodeToHRESULT(StatusCode status) noexcept {
switch (status)
{
case StatusCode::OK:
Expand All @@ -89,23 +89,23 @@ inline HRESULT StatusCodeToHRESULT(StatusCode status) noexcept {
case StatusCode::INVALID_ARGUMENT:
return E_INVALIDARG;
case StatusCode::NO_SUCHFILE:
return __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
case StatusCode::NO_MODEL:
return __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
case StatusCode::ENGINE_ERROR:
return E_FAIL;
case StatusCode::RUNTIME_EXCEPTION:
return E_FAIL;
case StatusCode::INVALID_PROTOBUF:
return __HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
return HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
case StatusCode::MODEL_LOADED:
return __HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
return HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
case StatusCode::NOT_IMPLEMENTED:
return E_NOTIMPL;
case StatusCode::INVALID_GRAPH:
return __HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
return HRESULT_FROM_WIN32(ERROR_FILE_CORRUPT);
case StatusCode::EP_FAIL:
return __HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
return HRESULT_FROM_WIN32(ERROR_INTERNAL_ERROR);
default:
return E_FAIL;
}
Expand Down
Loading

0 comments on commit 22f650b

Please sign in to comment.