Fix some warnings in our CUDA code (#7436)

This commit is contained in:
Changming Sun 2021-04-23 14:56:20 -07:00 committed by GitHub
parent 8889e717eb
commit 5208231126
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 7 deletions

View file

@ -28,7 +28,7 @@ class CUDAExternalAllocator : public CUDAAllocator {
typedef void (*ExternalFree)(void* p);
public:
CUDAExternalAllocator(OrtDevice::DeviceId device_id, const char* name, const void* alloc, const void* free)
CUDAExternalAllocator(OrtDevice::DeviceId device_id, const char* name, void* alloc, void* free)
: CUDAAllocator(device_id, name) {
alloc_ = reinterpret_cast<ExternalAlloc>(alloc);
free_ = reinterpret_cast<ExternalFree>(free);

View file

@ -17,7 +17,7 @@ namespace onnxruntime {
using namespace common;
template <typename ERRTYPE>
const char* CudaErrString(ERRTYPE x) {
const char* CudaErrString(ERRTYPE) {
ORT_NOT_IMPLEMENTED();
}

View file

@ -95,7 +95,7 @@ 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) : prop_(prop), handle_(handle) {
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 );
#else
@ -118,7 +118,6 @@ class CublasMathModeSetter {
}
private:
const cudaDeviceProp& prop_;
cublasHandle_t handle_;
cublasMath_t mode_;
bool enable_;

View file

@ -13,8 +13,8 @@
namespace onnxruntime {
// Information needed to construct CUDA execution providers.
struct CUDAExecutionProviderExternalAllocatorInfo {
const void* alloc{nullptr};
const void* free{nullptr};
void* alloc{nullptr};
void* free{nullptr};
CUDAExecutionProviderExternalAllocatorInfo() {
alloc = nullptr;

View file

@ -117,7 +117,7 @@ cudnnDataType_t CudnnTensor::GetDataType() {
ORT_THROW("cuDNN engine currently supports only single/double/half/int8/uint8 precision data types. Got:",
typeid(ElemType).name());
// Not reachable but GCC complains
return 0;
return CUDNN_DATA_FLOAT;
}
template<>