mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-26 03:00:54 +00:00
Expose provider factory C API, especially for CUDA users (#1461)
Exposed provider factory C API, for cpu and cuda providers, into the published packages.
This commit is contained in:
parent
31838fc9ee
commit
768ced703c
11 changed files with 30 additions and 8 deletions
|
|
@ -467,7 +467,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)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,18 @@
|
|||
CopyToOutputDirectory="Never"
|
||||
Visible="false"
|
||||
/>
|
||||
<None Include="$(OnnxRuntimeCsharpRoot)\..\include\onnxruntime\core\providers\cpu\cpu_provider_factory.h"
|
||||
PackagePath="\build\native\include"
|
||||
Pack="true"
|
||||
CopyToOutputDirectory="Never"
|
||||
Visible="false"
|
||||
/>
|
||||
<None Include="$(OnnxRuntimeCsharpRoot)\..\include\onnxruntime\core\providers\cuda\cuda_provider_factory.h"
|
||||
PackagePath="\build\native\include"
|
||||
Pack="true"
|
||||
CopyToOutputDirectory="Never"
|
||||
Visible="false"
|
||||
/>
|
||||
<None Include="$(NativeBuildOutputDir)\onnxruntime.lib"
|
||||
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
|
||||
Pack="true"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright(C) 2019 Intel Corporation
|
||||
// Licensed under the MIT License
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2019 JD.com Inc. JD AI
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright(C) 2019 Intel Corporation
|
||||
// Licensed under the MIT License
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "core/session/onnxruntime_c_api.h"
|
||||
#include "onnxruntime_c_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ steps:
|
|||
mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}
|
||||
mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\lib
|
||||
mkdir $(Build.BinariesDirectory)\${{parameters.artifactName}}\include
|
||||
|
||||
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\providers\cpu\cpu_provider_factory.h $(Build.BinariesDirectory)\${{parameters.artifactName}}\include
|
||||
copy $(Build.SourcesDirectory)\include\onnxruntime\core\providers\cuda\cuda_provider_factory.h $(Build.BinariesDirectory)\${{parameters.artifactName}}\include
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ then
|
|||
ln -s $LIB_NAME $BINARY_DIR/$ARTIFACT_NAME/lib/libonnxruntime.so
|
||||
fi
|
||||
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_c_api.h $BINARY_DIR/$ARTIFACT_NAME/include
|
||||
cp $SOURCE_DIR/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h $BINARY_DIR/$ARTIFACT_NAME/include
|
||||
cp $SOURCE_DIR/include/onnxruntime/core/providers/cuda/cuda_provider_factory.h $BINARY_DIR/$ARTIFACT_NAME/include
|
||||
|
||||
# copy the README, licence and TPN
|
||||
cp $SOURCE_DIR/README.md $BINARY_DIR/$ARTIFACT_NAME/README.md
|
||||
cp $SOURCE_DIR/docs/C_API.md $BINARY_DIR/$ARTIFACT_NAME/C_API.md
|
||||
|
|
|
|||
Loading…
Reference in a new issue