"test/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "7ee1c46b7831cdd5a66a46f23e4f32ffda1d0b52"
Commit 5ce4db2a authored by Rostyslav Geyyer's avatar Rostyslav Geyyer
Browse files

Fake the conversion

parent 27e6da87
...@@ -144,15 +144,21 @@ inline __host__ __device__ f8_t type_convert<f8_t, half_t>(half_t x) ...@@ -144,15 +144,21 @@ inline __host__ __device__ f8_t type_convert<f8_t, half_t>(half_t x)
{ {
#if defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__) #if defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__)
// convert to float and use native converion // convert to float and use native converion
return type_convert<f8_t>(type_convert<float>(x)); // return type_convert<f8_t>(type_convert<float>(x));
std::ignore = x;
const f8_t dummy = 0;
return dummy;
#else #else
constexpr bool negative_zero_nan = true; // constexpr bool negative_zero_nan = true;
constexpr bool clip = true; // constexpr bool clip = true;
constexpr f8_rounding_mode rm = f8_rounding_mode::standard; // constexpr f8_rounding_mode rm = f8_rounding_mode::standard;
constexpr uint32_t rng = 0; // constexpr uint32_t rng = 0;
return utils:: // return utils::
cast_to_f8<half_t, f8_t, negative_zero_nan, clip, (rm == f8_rounding_mode::stochastic)>( // cast_to_f8<half_t, f8_t, negative_zero_nan, clip, (rm == f8_rounding_mode::stochastic)>(
x, rng); // x, rng);
std::ignore = x;
const f8_t dummy = 0;
return dummy;
#endif #endif
} }
...@@ -218,15 +224,21 @@ inline __host__ __device__ bf8_t type_convert<bf8_t, half_t>(half_t x) ...@@ -218,15 +224,21 @@ inline __host__ __device__ bf8_t type_convert<bf8_t, half_t>(half_t x)
{ {
#if defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__) #if defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__)
// convert to float and use native converion // convert to float and use native converion
return type_convert<bf8_t>(type_convert<float>(x)); // return type_convert<bf8_t>(type_convert<float>(x));
std::ignore = x;
const f8_t dummy = 0;
return dummy;
#else #else
constexpr bool negative_zero_nan = true; // constexpr bool negative_zero_nan = true;
constexpr bool clip = true; // constexpr bool clip = true;
constexpr f8_rounding_mode rm = f8_rounding_mode::standard; // constexpr f8_rounding_mode rm = f8_rounding_mode::standard;
constexpr uint32_t rng = 0; // constexpr uint32_t rng = 0;
return utils:: // return utils::
cast_to_f8<half_t, bf8_t, negative_zero_nan, clip, (rm == f8_rounding_mode::stochastic)>( // cast_to_f8<half_t, bf8_t, negative_zero_nan, clip, (rm == f8_rounding_mode::stochastic)>(
x, rng); // x, rng);
std::ignore = x;
const bf8_t dummy = 0;
return dummy;
#endif #endif
} }
......
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