From 926e54a824d1012b10a134517872f5ccb432ddbc Mon Sep 17 00:00:00 2001 From: Mourad Gouicem Date: Thu, 10 Oct 2024 13:13:00 +0200 Subject: [PATCH] build: fix int/size_t implicit cast --- src/common/utils.hpp | 7 +++++++ src/cpu/reorder/simple_reorder.hpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/utils.hpp b/src/common/utils.hpp index 8a2ed9b66ef..48888adca95 100644 --- a/src/common/utils.hpp +++ b/src/common/utils.hpp @@ -209,6 +209,13 @@ constexpr bool any_null(Args... ptrs) { return one_of(nullptr, ptrs...); } +// Workaround on macos/gcc14.2 build error for static arrays +template +inline void array_copy(T dst[ndims], const T src[ndims], size_t size) { + assert(size < ndims); + for (size_t i = 0; i < size; ++i) + dst[i] = src[i]; +} template inline void array_copy(T *dst, const T *src, size_t size) { for (size_t i = 0; i < size; ++i) diff --git a/src/cpu/reorder/simple_reorder.hpp b/src/cpu/reorder/simple_reorder.hpp index 27dd374a1bd..a69c6d9058f 100644 --- a/src/cpu/reorder/simple_reorder.hpp +++ b/src/cpu/reorder/simple_reorder.hpp @@ -195,7 +195,7 @@ inline dim_t get_quant_off(const dims_t &input_idx, const int ndims, const int quant_mask, const dim_t g0, const dim_t g1, const memory_desc_t &quant_md) { dims_t quant_idx {}; - utils::array_copy(quant_idx, input_idx, ndims); + utils::array_copy(quant_idx, input_idx, ndims); utils::apply_mask_on_dims(quant_idx, ndims, quant_mask); // Note: an `idx` must divide by a group value as grouped quantization // applies to consecutive points.