diff --git a/include/onnxruntime/core/common/common.h b/include/onnxruntime/core/common/common.h index e4c9ad658d..f6356f4d87 100644 --- a/include/onnxruntime/core/common/common.h +++ b/include/onnxruntime/core/common/common.h @@ -150,8 +150,8 @@ std::vector GetStackTrace(); } \ } while (0) -// C++ Core Guideline check suppression -#ifdef _MSC_VER +// C++ Core Guideline check suppression. +#if defined(_MSC_VER) && !defined(__NVCC__) #define GSL_SUPPRESS(tag) [[gsl::suppress(tag)]] #else #define GSL_SUPPRESS(tag)