Commit a83e9dc6 authored by Umang Yadav's avatar Umang Yadav
Browse files

Remove clang diagnostics

parent 1e220c00
...@@ -22,12 +22,6 @@ ...@@ -22,12 +22,6 @@
#ifndef MIGRAPHX_GUARD_RTGLIB_FLOAT8_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_FLOAT8_HPP
#define MIGRAPHX_GUARD_RTGLIB_FLOAT8_HPP #define MIGRAPHX_GUARD_RTGLIB_FLOAT8_HPP
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma clang diagnostic ignored "-Wc++20-extensions"
#endif // __clang__
// We are clipping/saturation in down conversion by default. Unclipped version is not tested and // We are clipping/saturation in down conversion by default. Unclipped version is not tested and
// shouldn't be used without having enough tests. // shouldn't be used without having enough tests.
...@@ -52,7 +46,7 @@ namespace migraphx { ...@@ -52,7 +46,7 @@ namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace fp8 { namespace fp8 {
enum class migraphx_f8_rounding_mode enum class rounding_mode
{ {
standard, // standard rounding is doing RNE -- round to nearest even standard, // standard rounding is doing RNE -- round to nearest even
stochastic stochastic
...@@ -82,9 +76,9 @@ struct float8 ...@@ -82,9 +76,9 @@ struct float8
explicit constexpr float8(uint8_t bits, from_bits_t) : data(bits) {} explicit constexpr float8(uint8_t bits, from_bits_t) : data(bits) {}
explicit constexpr float8(float v, explicit constexpr float8(
migraphx::fp8::migraphx_f8_rounding_mode rm = float v,
migraphx::fp8::migraphx_f8_rounding_mode::standard, migraphx::fp8::rounding_mode rm = migraphx::fp8::rounding_mode::standard,
uint32_t rng = 0) uint32_t rng = 0)
{ {
if constexpr(T == migraphx::fp8::f8_type::fp8) if constexpr(T == migraphx::fp8::f8_type::fp8)
...@@ -92,11 +86,11 @@ struct float8 ...@@ -92,11 +86,11 @@ struct float8
#ifdef MIGRAPHX_F8_DOWNCAST_CLIPPING #ifdef MIGRAPHX_F8_DOWNCAST_CLIPPING
data = migraphx::fp8::impl:: data = migraphx::fp8::impl::
cast_to_f8<3, 4, float, FNUZ /*negative_zero_nan*/, true /*clip*/>( cast_to_f8<3, 4, float, FNUZ /*negative_zero_nan*/, true /*clip*/>(
v, (rm == migraphx::fp8::migraphx_f8_rounding_mode::stochastic), rng); v, (rm == migraphx::fp8::rounding_mode::stochastic), rng);
#else // MIGRAPHX_F8_DOWNCAST_CLIPPING #else // MIGRAPHX_F8_DOWNCAST_CLIPPING
data = migraphx::fp8::impl:: data = migraphx::fp8::impl::
cast_to_f8<3, 4, float, FNUZ /*negative_zero_nan*/, false /*clip*/>( cast_to_f8<3, 4, float, FNUZ /*negative_zero_nan*/, false /*clip*/>(
v, (rm == migraphx::fp8::migraphx_f8_rounding_mode::stochastic), rng); v, (rm == migraphx::fp8::rounding_mode::stochastic), rng);
#endif // MIGRAPHX_F8_DOWNCAST_CLIPPING #endif // MIGRAPHX_F8_DOWNCAST_CLIPPING
} }
else else
...@@ -104,11 +98,11 @@ struct float8 ...@@ -104,11 +98,11 @@ struct float8
#ifdef MIGRAPHX_F8_DOWNCAST_CLIPPING #ifdef MIGRAPHX_F8_DOWNCAST_CLIPPING
data = migraphx::fp8::impl:: data = migraphx::fp8::impl::
cast_to_f8<2, 5, float, FNUZ /*negative_zero_nan*/, true /*clip*/>( cast_to_f8<2, 5, float, FNUZ /*negative_zero_nan*/, true /*clip*/>(
v, (rm == migraphx::fp8::migraphx_f8_rounding_mode::stochastic), rng); v, (rm == migraphx::fp8::rounding_mode::stochastic), rng);
#else // MIGRAPHX_F8_DOWNCAST_CLIPPING #else // MIGRAPHX_F8_DOWNCAST_CLIPPING
data = migraphx::fp8::impl:: data = migraphx::fp8::impl::
cast_to_f8<2, 5, float, FNUZ /*negative_zero_nan*/, false /*clip*/>( cast_to_f8<2, 5, float, FNUZ /*negative_zero_nan*/, false /*clip*/>(
v, (rm == migraphx::fp8::migraphx_f8_rounding_mode::stochastic), rng); v, (rm == migraphx::fp8::rounding_mode::stochastic), rng);
#endif // rocblas_F8_downcast_clipping} #endif // rocblas_F8_downcast_clipping}
} }
} }
...@@ -412,7 +406,4 @@ MIGRAPHX_FP8_STD_OVERLOADS(migraphx::fp8::fp8e5m2fnuz) ...@@ -412,7 +406,4 @@ MIGRAPHX_FP8_STD_OVERLOADS(migraphx::fp8::fp8e5m2fnuz)
} // namespace std } // namespace std
// NOLINTEND // NOLINTEND
// ================================================================================================= // =================================================================================================
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif // MIGRAPHX_GUARD_RTGLIB_FLOAT8_HPP #endif // MIGRAPHX_GUARD_RTGLIB_FLOAT8_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment