From 3dfec5a3399a1510703b9eaeec50080005c873dc Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Thu, 6 May 2021 00:20:01 -0700 Subject: [PATCH] ROCM fix v2 --- onnxruntime/core/providers/cuda/cuda_common.h | 9 ++------- onnxruntime/core/providers/shared_library/provider_api.h | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/onnxruntime/core/providers/cuda/cuda_common.h b/onnxruntime/core/providers/cuda/cuda_common.h index b5fb6274f6..94f56a346c 100644 --- a/onnxruntime/core/providers/cuda/cuda_common.h +++ b/onnxruntime/core/providers/cuda/cuda_common.h @@ -11,12 +11,7 @@ #include "core/providers/cuda/shared_inc/fast_divmod.h" #include "gsl/gsl" -// Can't include "core/util/math.h" in a provider, so this is the part we need for cuda: namespace onnxruntime { -namespace math { -uint16_t floatToHalf(float f); -} - namespace cuda { #define CUDA_RETURN_IF_ERROR(expr) \ @@ -103,8 +98,8 @@ inline bool CalculateFdmStrides(gsl::span p, const std::vector= 7 : true ); +#if defined(CUDA_VERSION) && CUDA_VERSION < 11000 + enable_ = (mode == CUBLAS_TENSOR_OP_MATH ? prop.major >= 7 : true); #else enable_ = (mode == CUBLAS_TF32_TENSOR_OP_MATH ? prop.major >= 8 : true); #endif diff --git a/onnxruntime/core/providers/shared_library/provider_api.h b/onnxruntime/core/providers/shared_library/provider_api.h index 515b73b87d..906366adeb 100644 --- a/onnxruntime/core/providers/shared_library/provider_api.h +++ b/onnxruntime/core/providers/shared_library/provider_api.h @@ -13,9 +13,10 @@ #include "core/providers/cpu/tensor/onehot.h" #include "core/providers/cpu/tensor/gather_elements.h" +namespace onnxruntime { template using DeleteOnUnloadPtr = std::unique_ptr; - +} #else #define SHARED_PROVIDER 1