Revert "Trying to pass float16 type explicitly via macro(ugly method)"
This reverts commit 6f2b637113.
This commit is contained in:
@@ -324,12 +324,18 @@ struct fmt::formatter<OpenVulkano::Math::Timestamp>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct fmt::formatter<UNDERLYING_FLOAT16_TYPE> : fmt::formatter<float>
|
struct fmt::formatter<float16>
|
||||||
{
|
{
|
||||||
template<typename FormatContext>
|
template<typename ParseContext>
|
||||||
auto format(const UNDERLYING_FLOAT16_TYPE& f, FormatContext& ctx) const
|
constexpr auto parse(ParseContext& ctx)
|
||||||
{
|
{
|
||||||
return fmt::formatter<float>::format(static_cast<float>(f), ctx);
|
return fmt::formatter<float>{}.parse(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename FormatContext>
|
||||||
|
auto format(const float16& f, FormatContext& ctx) const
|
||||||
|
{
|
||||||
|
return fmt::formatter<float>{}.format(static_cast<float>(f), ctx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,10 @@
|
|||||||
// map a half float type, if available, to float16
|
// map a half float type, if available, to float16
|
||||||
#if __has_keyword(_Float16)
|
#if __has_keyword(_Float16)
|
||||||
typedef _Float16 float16;
|
typedef _Float16 float16;
|
||||||
#define UNDERLYING_FLOAT16_TYPE _Float16
|
|
||||||
#elif __has_keyword(__fp16)
|
#elif __has_keyword(__fp16)
|
||||||
typedef __fp16 float16;
|
typedef __fp16 float16;
|
||||||
#define UNDERLYING_FLOAT16_TYPE __fp16
|
|
||||||
#else
|
#else
|
||||||
#define USING_CUSTOM_FLOAT16
|
#define USING_CUSTOM_FLOAT16
|
||||||
#define UNDERLYING_FLOAT16_TYPE float16
|
|
||||||
|
|
||||||
class float16
|
class float16
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user