/* Copyright (c) Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: MIT */ #include #include #include #include #include template using promoted_enum_t = decltype(+std::declval()); template constexpr Enum invalidEnum(std::underlying_type_t value) { return static_cast(value); // NOLINT(clang-analyzer-optin.core.EnumCastOutOfRange) } // Return the max enum value representable by the result of integral promotion and the underlying type template constexpr auto maxEnum() { return std::min(std::numeric_limits>::max(), std::numeric_limits>::max()); }