Add TRT header file to ORT GPU nuget package (#8962)

This commit is contained in:
Changming Sun 2021-09-07 09:50:09 -07:00 committed by GitHub
parent 3be96f8a15
commit 0bb56a18cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 27 deletions

View file

@ -478,6 +478,12 @@ jobs:
arguments: '--configuration RelWithDebInfo -t:CreatePackage -p:Platform="Any CPU" -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=Microsoft.ML.OnnxRuntime.Gpu -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: BatchScript@1
displayName: 'Add TensorRT header file to the native nuGet package'
inputs:
filename: $(Build.SourcesDirectory)\tools\ci_build\github\windows\bundle_nuget_with_native_headers.bat
workingFolder: $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo
- task: CopyFiles@2
displayName: 'Copy nuget packages to: $(Build.ArtifactStagingDirectory)'
inputs:

View file

@ -1,27 +0,0 @@
REM Copyright (c) Microsoft Corporation. All rights reserved.
REM Licensed under the MIT License.
REM for available runtime identifiers, see https://github.com/dotnet/corefx/blob/release/3.1/pkg/Microsoft.NETCore.Platforms/runtime.json
set PATH=%CD%;%PATH%
SETLOCAL EnableDelayedExpansion
FOR /R %%i IN (*.nupkg) do (
set filename=%%~ni
IF NOT "!filename:~25,7!"=="Managed" (
mkdir runtimes\linux-x64\native
move onnxruntime-linux-x64-gpu\lib\libonnxruntime_providers_* runtimes\linux-x64\native
move onnxruntime-linux-x64-tensorrt\lib\libonnxruntime.so.1* runtimes\linux-x64\native\libonnxruntime.so
move onnxruntime-linux-x64-tensorrt\lib\libonnxruntime_providers_shared.so runtimes\linux-x64\native\libonnxruntime_providers_shared.so
move onnxruntime-linux-x64-tensorrt\lib\libonnxruntime_providers_tensorrt.so runtimes\linux-x64\native\libonnxruntime_providers_tensorrt.so
mkdir runtimes\win-x64\native
move onnxruntime-win-x64-tensorrt\lib\onnxruntime_providers_tensorrt.dll runtimes\win-x64\native\onnxruntime_providers_tensorrt.dll
move onnxruntime-win-x64-tensorrt\lib\onnxruntime_providers_shared.dll runtimes\win-x64\native\onnxruntime_providers_shared.dll
move onnxruntime-win-x64-tensorrt\lib\onnxruntime.dll runtimes\win-x64\native\onnxruntime.dll
move onnxruntime-win-x64-tensorrt\lib\onnxruntime.lib runtimes\win-x64\native\onnxruntime.lib
move onnxruntime-win-x64-tensorrt\lib\onnxruntime.pdb runtimes\win-x64\native\onnxruntime.pdb
7z a %%~ni.nupkg runtimes
mkdir build\native\include
move onnxruntime-linux-x64-tensorrt\include\tensorrt_provider_factory.h build\native\include\tensorrt_provider_factory.h
7z a %%~ni.nupkg build
)
)

View file

@ -0,0 +1,13 @@
REM Copyright (c) Microsoft Corporation. All rights reserved.
REM Licensed under the MIT License.
set PATH=%CD%;%PATH%
SETLOCAL EnableDelayedExpansion
FOR /R %%i IN (*.nupkg) do (
set filename=%%~ni
IF NOT "!filename:~25,7!"=="Managed" (
mkdir build\native\include
copy %BUILD_SOURCESDIRECTORY%\include\onnxruntime\core\providers\tensorrt\tensorrt_provider_factory.h build\native\include\tensorrt_provider_factory.h
7z a %%~ni.nupkg build
)
)