diff --git a/include/onnxruntime/core/framework/int2.h b/include/onnxruntime/core/framework/int2.h index 0d406d6fcd8d3..40af5746c9273 100644 --- a/include/onnxruntime/core/framework/int2.h +++ b/include/onnxruntime/core/framework/int2.h @@ -7,6 +7,7 @@ #include #include "core/common/common.h" #include +#include "onnxruntime_config.h" namespace onnxruntime { @@ -137,8 +138,16 @@ struct Int2x4Base { const size_t full_quads = src.size() / 4; // Process complete groups of 4 elements + for (; dst_i < full_quads; dst_i++) { +#if defined(__GNUC__) && defined(HAS_ARRAY_BOUNDS) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif dst[dst_i] = Int2x4Base(src[src_i], src[src_i + 1], src[src_i + 2], src[src_i + 3]); +#if defined(__GNUC__) && defined(HAS_ARRAY_BOUNDS) +#pragma GCC diagnostic pop +#endif src_i += 4; }