!31831 [MSLITE] fix cuda 10.1 compile log error

Merge pull request !31831 from Liu_Xuu/r1.6
This commit is contained in:
i-robot 2022-03-24 07:16:47 +00:00 committed by Gitee
commit 6bcd546eb4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 14 additions and 15 deletions

View File

@ -19,6 +19,7 @@
#include <cublas_v2.h>
#include "src/delegate/tensorrt/cuda_impl/cuda_helper.h"
#include "src/common/log_util.h"
// cublas API error checking
#define CUBLAS_CHECK_VOID(err) \

View File

@ -19,7 +19,6 @@
#include <cuda_runtime.h>
#include <algorithm>
#include "src/common/log_util.h"
class CudaHelper {
public:
@ -39,22 +38,20 @@ class CudaHelper {
#define GET_BLOCKS(total_threads) CudaHelper::GetInstance().GetBlocksNum(total_threads)
#define GET_THREADS CudaHelper::GetInstance().GetThreadNum()
#define CUDA_CHECK(ret) \
do { \
cudaError_t cuda_ret = (ret); \
if ((cuda_ret) != cudaSuccess) { \
MS_LOG(ERROR) << "cuda func call error: " << cudaGetErrorString(cuda_ret); \
return -1; \
} \
#define CUDA_CHECK(ret) \
do { \
cudaError_t cuda_ret = (ret); \
if ((cuda_ret) != cudaSuccess) { \
return -1; \
} \
} while (0)
#define CUDA_CHECK_VOID(ret) \
do { \
cudaError_t cuda_ret = (ret); \
if ((cuda_ret) != cudaSuccess) { \
MS_LOG(ERROR) << "cuda func call error: " << cudaGetErrorString(cuda_ret); \
return; \
} \
#define CUDA_CHECK_VOID(ret) \
do { \
cudaError_t cuda_ret = (ret); \
if ((cuda_ret) != cudaSuccess) { \
return; \
} \
} while (0)
#endif // MINDSPORE_LITE_SRC_DELEGATE_TENSORRT_CDUA_IMPL_CUDA_HELPER_H_

View File

@ -16,6 +16,7 @@
#include "src/delegate/tensorrt/cuda_impl/cudnn_utils.h"
#include <unordered_map>
#include "src/common/log_util.h"
namespace mindspore::lite {
cudnnDataType_t ConvertCudnnDataType(nvinfer1::DataType trt_datatype) {