From e3e33aa03f3bfedf572db5521869e7e8e6b038f3 Mon Sep 17 00:00:00 2001 From: Isaac Ault Date: Wed, 19 Feb 2025 10:33:42 +1000 Subject: [PATCH] Surpress deprecation warnings in ur_print.hpp --- unified-runtime/include/ur_print.hpp | 32 +++++++++---------- .../scripts/templates/print.hpp.mako | 14 ++++++++ 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/unified-runtime/include/ur_print.hpp b/unified-runtime/include/ur_print.hpp index fa59eaf2f8b6b..65fdb12288a8e 100644 --- a/unified-runtime/include/ur_print.hpp +++ b/unified-runtime/include/ur_print.hpp @@ -2823,10 +2823,10 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { os << "UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES"; break; #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated" - case UR_DEVICE_INFO_BFLOAT16: - os << "UR_DEVICE_INFO_BFLOAT16"; - break; +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + case UR_DEVICE_INFO_BFLOAT16: + os << "UR_DEVICE_INFO_BFLOAT16"; + break; #pragma GCC diagnostic pop case UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES: os << "UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES"; @@ -4301,20 +4301,20 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, os << ")"; } break; #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated" - case UR_DEVICE_INFO_BFLOAT16: { - const ur_bool_t *tptr = (const ur_bool_t *)ptr; - if (sizeof(ur_bool_t) > size) { - os << "invalid size (is: " << size - << ", expected: >=" << sizeof(ur_bool_t) << ")"; - return UR_RESULT_ERROR_INVALID_SIZE; - } - os << (const void *)(tptr) << " ("; +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + case UR_DEVICE_INFO_BFLOAT16: { + const ur_bool_t *tptr = (const ur_bool_t *)ptr; + if (sizeof(ur_bool_t) > size) { + os << "invalid size (is: " << size + << ", expected: >=" << sizeof(ur_bool_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; - os << *tptr; + os << *tptr; - os << ")"; - } break; + os << ")"; + } break; #pragma GCC diagnostic pop case UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES: { const uint32_t *tptr = (const uint32_t *)ptr; diff --git a/unified-runtime/scripts/templates/print.hpp.mako b/unified-runtime/scripts/templates/print.hpp.mako index 22011d1980927..3eee1d018c8f4 100644 --- a/unified-runtime/scripts/templates/print.hpp.mako +++ b/unified-runtime/scripts/templates/print.hpp.mako @@ -192,11 +192,18 @@ template inline ${x}_result_t printTagged(std::ostream &os, const v inline std::ostream &operator<<(std::ostream &os, enum ${th.make_enum_name(n, tags, obj)} value) { switch (value) { %for n, item in enumerate(obj['etors']): + %if th.etor_traits.is_deprecated_etor(item): +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + %endif <% ename = th.make_etor_name(n, tags, obj['name'], item['name']) %>case ${ename}: os << "${ename}"; break; + %if th.etor_traits.is_deprecated_etor(item): +#pragma GCC diagnostic pop + %endif %endfor default: os << "unknown enumerator"; @@ -217,6 +224,10 @@ template inline ${x}_result_t printTagged(std::ostream &os, const v switch (value) { %for n, item in enumerate(obj['etors']): + %if th.etor_traits.is_deprecated_etor(item): +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + %endif <% ename = th.make_etor_name(n, tags, obj['name'], item['name']) vtype = th.etor_get_associated_type(n, tags, item) @@ -260,6 +271,9 @@ template inline ${x}_result_t printTagged(std::ostream &os, const v os << ")"; %endif } break; + %if th.etor_traits.is_deprecated_etor(item): +#pragma GCC diagnostic pop + %endif %endfor default: os << "unknown enumerator";