From 2da4764fc281fbcb66be7860de0d513fd381e84e Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Fri, 20 Oct 2023 11:56:13 +0100 Subject: [PATCH] SWDEV-428244 - Set PARAMETERS_MIN_ALIGNMENT to the native alignment Change-Id: I14d8a0db4e575d6fa816754c52df405de88d9200 [ROCm/clr commit: 7868876db742fb4d44483892856a66d2993add03] --- projects/clr/rocclr/utils/flags.hpp | 2 +- projects/clr/rocclr/utils/macros.hpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/clr/rocclr/utils/flags.hpp b/projects/clr/rocclr/utils/flags.hpp index a5d849cc22..5c7ff852a0 100644 --- a/projects/clr/rocclr/utils/flags.hpp +++ b/projects/clr/rocclr/utils/flags.hpp @@ -40,7 +40,7 @@ debug(size_t, CPU_MEMORY_GUARD_PAGE_SIZE, 64, \ "Size in KB of CPU memory guard page") \ debug(size_t, CPU_MEMORY_ALIGNMENT_SIZE, 256, \ "Size in bytes for the default alignment for guarded memory on CPU") \ -debug(size_t, PARAMETERS_MIN_ALIGNMENT, 16, \ +debug(size_t, PARAMETERS_MIN_ALIGNMENT, NATIVE_ALIGNMENT_SIZE, \ "Minimum alignment required for the abstract parameters stack") \ debug(size_t, MEMOBJ_BASE_ADDR_ALIGN, 4*Ki, \ "Alignment of the base address of any allocate memory object") \ diff --git a/projects/clr/rocclr/utils/macros.hpp b/projects/clr/rocclr/utils/macros.hpp index aaf7e7bae0..8b65a2f16f 100644 --- a/projects/clr/rocclr/utils/macros.hpp +++ b/projects/clr/rocclr/utils/macros.hpp @@ -126,6 +126,14 @@ #define IS_WINDOWS false #endif +#if defined(__AVX512F__) +#define NATIVE_ALIGNMENT_SIZE 64 +#elif defined(__AVX__) +#define NATIVE_ALIGNMENT_SIZE 32 +#else +#define NATIVE_ALIGNMENT_SIZE 16 +#endif + #define IF_LEFT_true(x) x #define IF_LEFT_false(x) #define IF_RIGHT_true(x)