Skip to content

Commit

Permalink
Fix 1.20 cuda minimal build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
poweiw committed Nov 6, 2024
1 parent 742a0d3 commit ded156e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ function(AddTest)
if(onnxruntime_USE_CUDA)
#XXX: we should not need to do this. onnxruntime_test_all.exe should not have direct dependency on CUDA DLLs,
# otherwise it will impact when CUDA DLLs can be unloaded.
target_link_libraries(${_UT_TARGET} PRIVATE CUDA::cudart cudnn_frontend)
target_link_libraries(${_UT_TARGET} PRIVATE CUDA::cudart)
if(NOT onnxruntime_CUDA_MINIMAL)
target_link_libraries(${_UT_TARGET} PRIVATE cudnn_frontend)
endif()
endif()
target_link_libraries(${_UT_TARGET} PRIVATE ${_UT_LIBS} GTest::gtest GTest::gmock ${onnxruntime_EXTERNAL_LIBRARIES})
endif()
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/cuda/cudnn_fe_call.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "core/providers/cuda/shared_inc/cudnn_fe_call.h"
#include "core/providers/shared_library/provider_api.h"
#include <core/platform/env.h>
#if !defined(__CUDACC__)
#if !defined(__CUDACC__) && !defined(USE_CUDA_MINIMAL)
#include <cudnn_frontend.h>
#endif
#ifdef _WIN32
Expand All @@ -22,7 +22,7 @@ const char* CudaErrString(ERRTYPE) {
ORT_NOT_IMPLEMENTED();
}

#if !defined(__CUDACC__)
#if !defined(__CUDACC__) && !defined(USE_CUDA_MINIMAL)
#define CASE_ENUM_TO_STR_CUDNN_FE(x) \
case cudnn_frontend::error_code_t::x: \
return #x
Expand Down
4 changes: 3 additions & 1 deletion onnxruntime/core/providers/cuda/shared_inc/cudnn_fe_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "core/common/common.h"
#include "core/providers/cuda/cuda_pch.h"
#include "core/providers/cuda/shared_inc/cuda_call.h"
#if !defined(__CUDACC__)
#if !defined(__CUDACC__) && !defined(USE_CUDA_MINIMAL)
#include <cudnn_frontend.h>
#endif
namespace onnxruntime {
Expand All @@ -14,10 +14,12 @@ namespace onnxruntime {
// Error handling
// -----------------------------------------------------------------------

#ifndef USE_CUDA_MINIMAL
#define CUDNN_FE_CALL(expr) (CudaCall<cudnn_frontend::error_t, false, \
cudnn_frontend::error_code_t>((cudnn_frontend::error_t)(expr), #expr, "CUDNN_FE", \
cudnn_frontend::error_code_t::OK, "", __FILE__, __LINE__))
#define CUDNN_FE_CALL_THROW(expr) (CudaCall<cudnn_frontend::error_t, true, \
cudnn_frontend::error_code_t>((cudnn_frontend::error_t)(expr), #expr, "CUDNN_FE", \
cudnn_frontend::error_code_t::OK, "", __FILE__, __LINE__))
#endif
} // namespace onnxruntime

0 comments on commit ded156e

Please sign in to comment.