Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c45d0cb
Filter data (Weights) reorder optimization
sreekanth-yalachigere Dec 10, 2018
8904b82
check provider_ for nullptr
sreekanth-yalachigere Dec 10, 2018
e8cdd63
PR Review changes: thread safe. weights map object private
sreekanth-yalachigere Dec 11, 2018
f95cea9
using Conv Parameters key to make weights id unique
sreekanth-yalachigere Dec 11, 2018
d0f15b1
PR Review changes: thread safe. weights map object private
sreekanth-yalachigere Dec 11, 2018
cf57d17
removed convParam string from weight key. Weight Id is unique
sreekanth-yalachigere Dec 12, 2018
5a8acd7
directly updating dst arg with src arg when adding an edge. no need u…
linkerzhang Dec 17, 2018
82d0441
Kezhan/partition logic update (#164)
linkerzhang Dec 17, 2018
d0544a8
Rashuai/gathernd op (#170)
RandyShuai Dec 17, 2018
b0f27ba
Allow using MKLML header/libs when use_mklml is specified (#178)
Dec 17, 2018
8c5d105
fix typo
Dec 17, 2018
71c56b6
Fix array feature extractor out of bounds access issue (#194)
edgchen1 Dec 18, 2018
0287019
C# Gpu : Minor updates to exception message (#201)
jignparm Dec 18, 2018
773114a
More C header naming changes (#202)
RyanUnderhill Dec 18, 2018
0aa1b54
Updated build.py to support relative CMake/CTest paths and did some m…
edgchen1 Dec 18, 2018
d4131a3
Disable csharp pretrained tests temporarily (#207)
jignparm Dec 18, 2018
c0ec7d5
Clean up garbage files (#208)
Dec 18, 2018
37b74c7
add gemmlowp as submodule. (#206)
linkerzhang Dec 18, 2018
dc8b37f
update onnx (#209)
Dec 18, 2018
beb326f
Simplify logic around creating relationship between nodes for implici…
skottmckay Dec 18, 2018
39f47f8
Adding the include folder for the C Windows pkg. (#198)
pranavsharma Dec 19, 2018
334e329
Increment/decrement UseCount for outputs so that we don't prematurely…
skottmckay Dec 19, 2018
ab350fa
Re-structure the inference session initialization to (#217)
skottmckay Dec 19, 2018
0248390
Add support for checking for F16C support (https://en.wikipedia.org/w…
jessebenson Dec 19, 2018
ac3a081
Enable release build in Windows CI pipelines (#220)
Dec 19, 2018
4d010fb
Add null check before calling node.op_->Deprecated(). (#211)
BowenBao Dec 19, 2018
b9cc134
Make sure tensor sizes are 64-byte aligned (#222)
Dec 19, 2018
94f8f2b
placeholder for internal contrib ops (#219)
souptc Dec 19, 2018
e63572c
Updated ArrayFeatureExtractor op to retain old output shape behavior.
edgchen1 Dec 19, 2018
84231ba
support hyperbolic ops (#223)
ashku-ms Dec 19, 2018
e97caa7
change mkldnn so path (#210)
Dec 19, 2018
255ee39
Fix memory leak by improper handling of std::string typed (#227)
yuslepukhin Dec 20, 2018
1d95c93
[optimization] avoid vector copy and reduce allocation. (#203)
zwxxx Dec 20, 2018
0dca080
remove useless internal schema file (#226)
souptc Dec 20, 2018
abce604
Print hex value for float compare when test failed (#228)
Dec 20, 2018
eb867be
update mkldnn to 0.17.2 (#231)
jywu-msft Dec 20, 2018
a19b624
MaxUnpool Operator - CPU Implementation (#177)
ashku-ms Dec 20, 2018
a43382e
Jignparm/csharp gpu (#221)
jignparm Dec 20, 2018
c453b48
update kernel memory type interface (#225)
souptc Dec 20, 2018
4f8af6a
Filter data (Weights) reorder optimization
sreekanth-yalachigere Dec 10, 2018
8808e14
check provider_ for nullptr
sreekanth-yalachigere Dec 10, 2018
7c2a8d8
PR Review changes: thread safe. weights map object private
sreekanth-yalachigere Dec 11, 2018
32ee169
using Conv Parameters key to make weights id unique
sreekanth-yalachigere Dec 11, 2018
fe640a8
removed convParam string from weight key. Weight Id is unique
sreekanth-yalachigere Dec 12, 2018
e98e362
merge
sreekanth-yalachigere Dec 20, 2018
a37887c
More intuitive ordering to the API functions (#233)
RyanUnderhill Dec 20, 2018
c7ad8d9
Filter data (Weights) reorder optimization
sreekanth-yalachigere Dec 10, 2018
9787cc8
check provider_ for nullptr
sreekanth-yalachigere Dec 10, 2018
4460531
PR Review changes: thread safe. weights map object private
sreekanth-yalachigere Dec 11, 2018
dbb53a1
using Conv Parameters key to make weights id unique
sreekanth-yalachigere Dec 11, 2018
f321cf9
PR Review changes: thread safe. weights map object private
sreekanth-yalachigere Dec 11, 2018
591fa08
removed convParam string from weight key. Weight Id is unique
sreekanth-yalachigere Dec 12, 2018
42a710a
check provider_ for nullptr
sreekanth-yalachigere Dec 10, 2018
dff5560
using Conv Parameters key to make weights id unique
sreekanth-yalachigere Dec 11, 2018
47359cb
weight name as key
sreekanth-yalachigere Dec 21, 2018
3e757bb
Merge branch 'master' of https://github.com/sreekanth-yalachigere/onn…
sreekanth-yalachigere Dec 21, 2018
345b440
weights as key
sreekanth-yalachigere Dec 21, 2018
431344e
Relu and Sum
sreekanth-yalachigere Dec 21, 2018
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "cmake/external/gsl"]
path = cmake/external/gsl
url = https://github.com/Microsoft/GSL.git
[submodule "cmake/external/gemmlowp"]
path = cmake/external/gemmlowp
url = https://github.com/google/gemmlowp.git
72 changes: 45 additions & 27 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -374,29 +374,6 @@ else()
endif()
endif()

if (onnxruntime_USE_TVM)
if (WIN32 AND MSVC)
# wd4100: identifier' : unreferenced formal parameter
# wd4244: conversion from 'int' to 'char', possible loss of data
# wd4251: class X needs to have dll-interface to be used by clients of class Y
# wd4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
# wd4275: non dll-interface class X used as base for dll-interface class Y
# wd4389: signed/unsigned mismatch
# wd4456: declaration of X hides previous local declaration
set(DISABLED_WARNINGS_FOR_TVM "/wd4100" "/wd4244" "/wd4251" "/wd4267" "/wd4275" "/wd4389" "/wd4456")
else()
set(DISABLED_WARNINGS_FOR_TVM "-Wno-error=extra" "-Wno-error=ignored-qualifiers")
if(HAS_UNUSED_PARAMETER)
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=unused-parameter")
endif()
if(HAS_CATCH_VALUE)
#TODO: send a PR to TVM and fix it
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=catch-value")
endif()
endif()
include(onnxruntime_codegen.cmake)
endif()

if (onnxruntime_USE_JEMALLOC)
if (Win32)
message( FATAL_ERROR "Jemalloc is not supported on Windows." )
Expand All @@ -412,11 +389,27 @@ include_directories(
$<TARGET_PROPERTY:GSL,INTERFACE_INCLUDE_DIRECTORIES>
)

if (onnxruntime_USE_MKLDNN OR onnxruntime_USE_MKLML)
include(mkldnn)
endif()

if (onnxruntime_USE_MKLML)
add_definitions(-DUSE_MKLML=1)
# USE_MKML_FOR_BLAS may cause numerical differences in tests so disable by default
#add_definitions(-DUSE_MKLML_FOR_BLAS=1)
if (WIN32 OR APPLE)
list(APPEND onnxruntime_EXTERNAL_LIBRARIES mklml)
else()
list(APPEND onnxruntime_EXTERNAL_LIBRARIES mklml_intel)
endif()
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES project_mklml)
link_directories(${MKLML_LIB_DIR})
endif()

if (onnxruntime_USE_MKLDNN)
add_definitions(-DUSE_MKLDNN=1)
include(mkldnn)
list(APPEND onnxruntime_EXTERNAL_LIBRARIES mkldnn)
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES mkldnn)
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES project_mkldnn)
link_directories(${MKLDNN_LIB_DIR})
endif()

Expand All @@ -442,7 +435,6 @@ if (onnxruntime_USE_CUDA)
endif ()
file(TO_CMAKE_PATH ${onnxruntime_CUDNN_HOME} onnxruntime_CUDNN_HOME)
find_package(CUDA 9.0 REQUIRED)
include(cub)
set(CUDA_LINK_LIBRARIES_KEYWORD PRIVATE)
if (WIN32)
link_directories(${onnxruntime_CUDNN_HOME}/lib/x64)
Expand All @@ -453,7 +445,6 @@ if (onnxruntime_USE_CUDA)
set(ONNXRUNTIME_CUDA_LIBRARIES cudnn_static cublas_static culibos)
endif()
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${ONNXRUNTIME_CUDA_LIBRARIES})
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES cub)

set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_30,code=sm_30") # K series
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_50,code=sm_50") # M series
Expand All @@ -465,6 +456,33 @@ if (onnxruntime_USE_CUDA)
endif()
endif()

if (onnxruntime_USE_TVM)
if (WIN32 AND MSVC)
# wd4100: identifier' : unreferenced formal parameter
# wd4244: conversion from 'int' to 'char', possible loss of data
# wd4251: class X needs to have dll-interface to be used by clients of class Y
# wd4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
# wd4275: non dll-interface class X used as base for dll-interface class Y
# wd4389: signed/unsigned mismatch
# wd4456: declaration of X hides previous local declaration
set(DISABLED_WARNINGS_FOR_TVM "/wd4100" "/wd4244" "/wd4251" "/wd4267" "/wd4275" "/wd4389" "/wd4456")
else()
set(DISABLED_WARNINGS_FOR_TVM "-Wno-error=extra" "-Wno-error=ignored-qualifiers")
if(HAS_UNUSED_PARAMETER)
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=unused-parameter")
endif()
if(HAS_CATCH_VALUE)
#TODO: send a PR to TVM and fix it
list(APPEND DISABLED_WARNINGS_FOR_TVM "-Wno-error=catch-value")
endif()
endif()
include(onnxruntime_codegen.cmake)
endif()

if (onnxruntime_ENABLE_MICROSOFT_INTERNAL)
add_definitions(-DMICROSOFT_INTERNAL)
endif()

#names in this var must match the directory names under onnxruntime/core/providers
set(ONNXRUNTIME_PROVIDER_NAMES cpu)

Expand Down
30 changes: 0 additions & 30 deletions cmake/external/cub.cmake

This file was deleted.

1 change: 1 addition & 0 deletions cmake/external/gemmlowp
Submodule gemmlowp added at a3df02
70 changes: 43 additions & 27 deletions cmake/external/mkldnn.cmake
Original file line number Diff line number Diff line change
@@ -1,57 +1,73 @@
include (ExternalProject)

set(MKLDNN_URL https://github.com/intel/mkl-dnn.git)
# If MKLDNN_TAG is updated, check if platform.cmake.patch needs to be updated.
set(MKLDNN_TAG v0.17.1)
set(MKLDNN_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/mkl-dnn/src/mkl-dnn/src)
set(MKLDNN_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/mkl-dnn/install)
set(MKLDNN_LIB_DIR ${MKLDNN_INSTALL}/lib)
set(MKLDNN_INCLUDE_DIR ${MKLDNN_INSTALL}/include)

set(MKLDNN_PATCH_COMMAND1 git apply ${CMAKE_SOURCE_DIR}/patches/mkldnn/platform.cmake.patch)
# discard prior changes due to patching in mkldnn source to unblock incremental builds.
set(MKLDNN_PATCH_DISCARD_COMMAND cd ${MKLDNN_SOURCE} && git checkout -- .)
# If MKLDNN_TAG is updated, check if MKLML_VERSION and platform.cmake.patch need to be updated.
set(MKLDNN_TAG v0.17.2)
set(MKLML_VERSION 2019.0.1.20180928)

if(WIN32)
set(MKLML_OS_VERSION_STR "win")
set(MKLML_FILE_EXTENSION "zip")
set(MKLDNN_SHARED_LIB mkldnn.dll)
set(MKLDNN_IMPORT_LIB mkldnn.lib)
if(onnxruntime_USE_MKLML)
set(DOWNLOAD_MKLML ${MKLDNN_SOURCE}/scripts/prepare_mkl.bat)
set(MKLML_SHARED_LIB mklml.dll)
set(MKLML_IMPORT_LIB mklml.lib)
set(IOMP5MD_SHARED_LIB libiomp5md.dll)
set(IOMP5MD_IMPORT_LIB libiomp5md.lib)
endif()
else()
set(MKLML_FILE_EXTENSION "tgz")
if (APPLE)
set(MKLDNN_SHARED_LIB libmkldnn.0.dylib)
set(MKLML_OS_VERSION_STR "mac")
else()
set(MKLDNN_SHARED_LIB libmkldnn.so.0)
set(MKLML_OS_VERSION_STR "lnx")
endif()
if(onnxruntime_USE_MKLML)
set(DOWNLOAD_MKLML ${MKLDNN_SOURCE}/scripts/prepare_mkl.sh)
set(MKLML_SHARED_LIB libmklml_intel.so)
set(IOMP5MD_SHARED_LIB libiomp5.so)
endif()
endif()

if(NOT onnxruntime_USE_MKLDNN OR EXISTS ${MKLDNN_SOURCE}/external)
set(DOWNLOAD_MKLML "")
if (onnxruntime_USE_MKLML)
set(MKLML_URL https://github.com/intel/mkl-dnn/releases/download/${MKLDNN_TAG}/mklml_${MKLML_OS_VERSION_STR}_${MKLML_VERSION}.${MKLML_FILE_EXTENSION})

ExternalProject_Add(project_mklml
PREFIX mklml
URL ${MKLML_URL}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
UPDATE_COMMAND ""
INSTALL_COMMAND "" )

set(MKML_DIR ${CMAKE_CURRENT_BINARY_DIR}/mklml/src/project_mklml)
set(MKLML_INCLUDE_DIR "${MKML_DIR}/include")
set(MKLML_LIB_DIR "${MKML_DIR}/lib")
link_directories(${MKLML_LIB_DIR})
endif()

ExternalProject_Add(project_mkldnn
if (onnxruntime_USE_MKLDNN)
set(MKLDNN_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/mkl-dnn/src/mkl-dnn/src)
set(MKLDNN_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/mkl-dnn/install)
set(MKLDNN_LIB_DIR ${MKLDNN_INSTALL}/lib)
set(MKLDNN_INCLUDE_DIR ${MKLDNN_INSTALL}/include)

set(MKLDNN_PATCH_COMMAND1 git apply ${CMAKE_SOURCE_DIR}/patches/mkldnn/platform.cmake.patch)
# discard prior changes due to patching in mkldnn source to unblock incremental builds.
set(MKLDNN_PATCH_DISCARD_COMMAND cd ${MKLDNN_SOURCE} && git checkout -- .)

ExternalProject_Add(project_mkldnn
PREFIX mkl-dnn
GIT_REPOSITORY ${MKLDNN_URL}
GIT_TAG ${MKLDNN_TAG}
PATCH_COMMAND ${DOWNLOAD_MKLML} COMMAND ${MKLDNN_PATCH_DISCARD_COMMAND} COMMAND ${MKLDNN_PATCH_COMMAND1}
PATCH_COMMAND ${MKLDNN_PATCH_DISCARD_COMMAND} COMMAND ${MKLDNN_PATCH_COMMAND1}
SOURCE_DIR ${MKLDNN_SOURCE}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL}
)

if(WIN32)
add_library(mkldnn STATIC IMPORTED)
set_property(TARGET mkldnn PROPERTY IMPORTED_LOCATION ${MKLDNN_LIB_DIR}/${MKLDNN_IMPORT_LIB})
else()
add_library(mkldnn SHARED IMPORTED)
set_property(TARGET mkldnn PROPERTY IMPORTED_LOCATION ${MKLDNN_LIB_DIR}/${MKLDNN_SHARED_LIB})
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL} -DMKLROOT=${MKML_DIR}
)
link_directories(${MKLDNN_LIB_DIR})
if (onnxruntime_USE_MKLML)
add_dependencies(project_mkldnn project_mklml)
endif()
endif()
add_dependencies(mkldnn project_mkldnn)
include_directories(${MKLDNN_INCLUDE_DIR})
4 changes: 2 additions & 2 deletions cmake/onnxruntime_providers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ source_group(TREE ${ONNXRUNTIME_ROOT} FILES ${onnxruntime_contrib_ops_srcs})
add_library(onnxruntime_providers ${onnxruntime_providers_common_srcs} ${onnxruntime_providers_srcs} ${onnxruntime_contrib_ops_srcs})
onnxruntime_add_include_to_target(onnxruntime_providers onnx protobuf::libprotobuf)
target_include_directories(onnxruntime_providers PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS})
add_dependencies(onnxruntime_providers eigen gsl onnx)
add_dependencies(onnxruntime_providers eigen gsl onnx ${onnxruntime_EXTERNAL_DEPENDENCIES})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/cpu DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers)
set_target_properties(onnxruntime_providers PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(onnxruntime_providers PROPERTIES FOLDER "ONNXRuntime")
Expand Down Expand Up @@ -94,7 +94,7 @@ if (onnxruntime_USE_MKLDNN)
onnxruntime_add_include_to_target(onnxruntime_providers_mkldnn onnx protobuf::libprotobuf)
add_dependencies(onnxruntime_providers_mkldnn eigen ${onnxruntime_EXTERNAL_DEPENDENCIES})
set_target_properties(onnxruntime_providers_mkldnn PROPERTIES FOLDER "ONNXRuntime")
target_include_directories(onnxruntime_providers_mkldnn PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS})
target_include_directories(onnxruntime_providers_mkldnn PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} ${MKLDNN_INCLUDE_DIR} ${MKLML_INCLUDE_DIR})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/mkldnn DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core/providers)
set_target_properties(onnxruntime_providers_mkldnn PROPERTIES LINKER_LANGUAGE CXX)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/onnxruntime_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ if (onnxruntime_USE_MKLML)
add_custom_command(
TARGET onnxruntime_pybind11_state POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${MKLDNN_LIB_DIR}/${MKLML_SHARED_LIB} ${MKLDNN_LIB_DIR}/${IOMP5MD_SHARED_LIB}
${MKLML_LIB_DIR}/${MKLML_SHARED_LIB} ${MKLML_LIB_DIR}/${IOMP5MD_SHARED_LIB}
$<TARGET_FILE_DIR:${test_data_target}>/onnxruntime/capi/
)
endif()
2 changes: 1 addition & 1 deletion cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ if (onnxruntime_USE_MKLML)
add_custom_command(
TARGET ${test_data_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${MKLDNN_LIB_DIR}/${MKLML_SHARED_LIB} ${MKLDNN_LIB_DIR}/${IOMP5MD_SHARED_LIB}
${MKLML_LIB_DIR}/${MKLML_SHARED_LIB} ${MKLML_LIB_DIR}/${IOMP5MD_SHARED_LIB}
$<TARGET_FILE_DIR:${test_data_target}>
)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/onnxruntime_util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ file(GLOB_RECURSE onnxruntime_util_srcs
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_util_srcs})

add_library(onnxruntime_util ${onnxruntime_util_srcs})
target_include_directories(onnxruntime_util PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS})
target_include_directories(onnxruntime_util PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} ${MKLDNN_INCLUDE_DIR} ${MKLML_INCLUDE_DIR})
onnxruntime_add_include_to_target(onnxruntime_util onnx protobuf::libprotobuf)
set_target_properties(onnxruntime_util PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(onnxruntime_util PROPERTIES FOLDER "ONNXRuntime")
Expand Down
6 changes: 0 additions & 6 deletions cmake/patches/cub/CMakeLists.txt

This file was deleted.

27 changes: 0 additions & 27 deletions cmake/patches/protobuf.patch

This file was deleted.

2 changes: 0 additions & 2 deletions csharp/src/Microsoft.ML.OnnxRuntime/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ internal enum ErrorCode
InvalidGraph = 10,
ShapeInferenceNotRegistered = 11,
RequirementNotRegistered = 12,
ExecutionProviderDLLNotFound = 13
}

/// <summary>
Expand All @@ -49,7 +48,6 @@ public class OnnxRuntimeException: Exception
{ ErrorCode.InvalidGraph, "InvalidGraph" },
{ ErrorCode.ShapeInferenceNotRegistered, "ShapeInferenceNotRegistered" },
{ ErrorCode.RequirementNotRegistered, "RequirementNotRegistered" },
{ ErrorCode.ExecutionProviderDLLNotFound, "ExecutionProviderDLLNotFound" }
};

internal OnnxRuntimeException(ErrorCode errorCode, string message)
Expand Down
8 changes: 4 additions & 4 deletions csharp/src/Microsoft.ML.OnnxRuntime/InferenceSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public InferenceSession(string modelPath, SessionOptions options)
{
if (_nativeHandle != IntPtr.Zero)
{
NativeMethods.ReleaseONNXSession(_nativeHandle);
NativeMethods.OrtReleaseSession(_nativeHandle);
_nativeHandle = IntPtr.Zero;
}
throw e;
Expand Down Expand Up @@ -178,7 +178,7 @@ internal IReadOnlyCollection<NamedOnnxValue> Run(IReadOnlyCollection<NamedOnnxVa
{
if (outputValueArray[i] != IntPtr.Zero)
{
NativeMethods.ReleaseONNXValue(outputValueArray[i]);
NativeMethods.OrtReleaseValue(outputValueArray[i]);
}
}
throw e;
Expand All @@ -188,7 +188,7 @@ internal IReadOnlyCollection<NamedOnnxValue> Run(IReadOnlyCollection<NamedOnnxVa
// always unpin the input buffers, and delete the native Onnx value objects
for (int i = 0; i < inputs.Count; i++)
{
NativeMethods.ReleaseONNXValue(inputTensors[i]); // this should not release the buffer, but should delete the native tensor object
NativeMethods.OrtReleaseValue(inputTensors[i]); // this should not release the buffer, but should delete the native tensor object
pinnedBufferHandles[i].Dispose();
}
}
Expand Down Expand Up @@ -340,7 +340,7 @@ protected virtual void Dispose(bool disposing)
// cleanup unmanaged resources
if (_nativeHandle != IntPtr.Zero)
{
NativeMethods.ReleaseONNXSession(_nativeHandle);
NativeMethods.OrtReleaseSession(_nativeHandle);
}
}

Expand Down
Loading