From e2ee3fc2c9af0a1b45e767b79b28e15ef472361e Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:45:00 +0100 Subject: [PATCH] GPU Metal: provide numeric_limits and the layout traits in GPUCommonTypeTraits MSL has metal::numeric_limits but no std:: one, and no is_standard_layout_v or is_trivially_copyable_v. Shared headers that use them in static_asserts or type selections then compile for Metal unchanged. --- GPU/Common/GPUCommonTypeTraits.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GPU/Common/GPUCommonTypeTraits.h b/GPU/Common/GPUCommonTypeTraits.h index 6d72f164771bc..96688ab7daa2b 100644 --- a/GPU/Common/GPUCommonTypeTraits.h +++ b/GPU/Common/GPUCommonTypeTraits.h @@ -33,6 +33,13 @@ #endif namespace std { +#ifdef __METAL__ +using metal::numeric_limits; +template +constant constexpr bool is_standard_layout_v = __is_standard_layout(T); +template +constant constexpr bool is_trivially_copyable_v = __is_trivially_copyable(T); +#endif template struct conditional { typedef T type;