diff --git a/vir/simd_execution.h b/vir/simd_execution.h index d8a6c32..8333a69 100644 --- a/vir/simd_execution.h +++ b/vir/simd_execution.h @@ -474,16 +474,26 @@ case##N: {}; template - inline constexpr std::size_t memory_alignment_v = [] { - if constexpr (stdx::is_simd_v) - return stdx::memory_alignment_v; - else if constexpr (requires { - {V::template memory_alignment} -> std::same_as; - }) - return V::template memory_alignment; - else - return alignof(T); - }(); + struct memory_alignment + : vir::constexpr_wrapper + {}; + + template + requires (stdx::is_simd_v) + struct memory_alignment + : stdx::memory_alignment + {}; + + template + requires (not stdx::is_simd_v) and requires { + {V::template memory_alignment} -> std::same_as; + } + struct memory_alignment + : vir::constexpr_wrapper> + {}; + + template + inline constexpr std::size_t memory_alignment_v = memory_alignment::value; template struct prologue