mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-27 22:45:57 +00:00
[TensorRT EP] Properly set CUDA_INCLUDE_DIR for onnx-tensorrt (#18274)
https://github.com/microsoft/onnxruntime/pull/17468 The above PR didn't fully fix the issue for some environments. This PR fixes this.
This commit is contained in:
parent
08eaa1c55d
commit
dfafcb58aa
1 changed files with 3 additions and 1 deletions
|
|
@ -57,12 +57,14 @@
|
|||
URL ${DEP_URL_onnx_tensorrt}
|
||||
URL_HASH SHA1=${DEP_SHA1_onnx_tensorrt}
|
||||
)
|
||||
if (NOT CUDA_INCLUDE_DIR)
|
||||
set(CUDA_INCLUDE_DIR ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) # onnx-tensorrt repo needs this variable to build
|
||||
endif()
|
||||
# The onnx_tensorrt repo contains a test program, getSupportedAPITest, which doesn't support Windows. It uses
|
||||
# unistd.h. So we must exclude it from our build. onnxruntime_fetchcontent_makeavailable is for the purpose.
|
||||
onnxruntime_fetchcontent_makeavailable(onnx_tensorrt)
|
||||
include_directories(${onnx_tensorrt_SOURCE_DIR})
|
||||
set(CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
|
||||
set(CUDA_INCLUDE_DIR ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) # onnx-tensorrt repo needs this variable to build
|
||||
if ( CMAKE_COMPILER_IS_GNUCC )
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in a new issue