mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Fix some warnings in our CUDA code (#7436)
This commit is contained in:
parent
8889e717eb
commit
5208231126
5 changed files with 6 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace onnxruntime {
|
|||
using namespace common;
|
||||
|
||||
template <typename ERRTYPE>
|
||||
const char* CudaErrString(ERRTYPE x) {
|
||||
const char* CudaErrString(ERRTYPE) {
|
||||
ORT_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<>
|
||||
|
|
|
|||
Loading…
Reference in a new issue