ROCM fix v2

This commit is contained in:
Ryan Hill 2021-05-06 00:20:01 -07:00
parent 0853a58cfa
commit 3dfec5a339
2 changed files with 4 additions and 8 deletions

View file

@ -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<fast_divmod> p, const std::vector<int6
class CublasMathModeSetter {
public:
CublasMathModeSetter(const cudaDeviceProp& prop, cublasHandle_t handle, cublasMath_t mode) : handle_(handle) {
#if defined(CUDA_VERSION) && CUDA_VERSION < 11000
enable_ = (mode == CUBLAS_TENSOR_OP_MATH ? prop.major >= 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

View file

@ -13,9 +13,10 @@
#include "core/providers/cpu/tensor/onehot.h"
#include "core/providers/cpu/tensor/gather_elements.h"
namespace onnxruntime {
template <typename T>
using DeleteOnUnloadPtr = std::unique_ptr<T>;
}
#else
#define SHARED_PROVIDER 1