diff --git a/onnxruntime/core/providers/cuda/shared_inc/cuda_utils.h b/onnxruntime/core/providers/cuda/shared_inc/cuda_utils.h index 5a5303f45f..1efd51d1ba 100644 --- a/onnxruntime/core/providers/cuda/shared_inc/cuda_utils.h +++ b/onnxruntime/core/providers/cuda/shared_inc/cuda_utils.h @@ -5,10 +5,13 @@ // as currently nvcc cannot compile all onnxruntime headers #pragma once + #include +#include #include -#include "fast_divmod.h" + #include "core/common/common.h" +#include "core/providers/cuda/shared_inc/fast_divmod.h" namespace onnxruntime { namespace cuda { @@ -57,7 +60,10 @@ struct TArray { } TArray(const std::vector& vec) : TArray(static_cast(vec.size())) { +// std::is_trivially_copyable is not implemented in older versions of GCC +#if !defined(__GNUC__) || __GNUC__ >= 5 static_assert(std::is_trivially_copyable::value, "T must be trivially copyable."); +#endif memcpy(data_, vec.data(), vec.size() * sizeof(T)); }