Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
ca47e0c0
Commit
ca47e0c0
authored
Oct 30, 2023
by
Rostyslav Geyyer
Browse files
Bring the conversion back
parent
b0b12cdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
28 deletions
+16
-28
include/ck/utility/type_convert.hpp
include/ck/utility/type_convert.hpp
+16
-28
No files found.
include/ck/utility/type_convert.hpp
View file @
ca47e0c0
...
...
@@ -144,21 +144,15 @@ inline __host__ __device__ f8_t type_convert<f8_t, half_t>(half_t x)
{
#if defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__)
// convert to float and use native converion
// return type_convert<f8_t>(type_convert<float>(x));
std
::
ignore
=
x
;
const
f8_t
dummy
=
0
;
return
dummy
;
return
type_convert
<
f8_t
>
(
type_convert
<
float
>
(
x
));
#else
// constexpr bool negative_zero_nan = true;
// constexpr bool clip = true;
// constexpr f8_rounding_mode rm = f8_rounding_mode::standard;
// constexpr uint32_t rng = 0;
// return utils::
// cast_to_f8<half_t, f8_t, negative_zero_nan, clip, (rm == f8_rounding_mode::stochastic)>(
// x, rng);
std
::
ignore
=
x
;
const
f8_t
dummy
=
0
;
return
dummy
;
constexpr
bool
negative_zero_nan
=
true
;
constexpr
bool
clip
=
true
;
constexpr
f8_rounding_mode
rm
=
f8_rounding_mode
::
standard
;
constexpr
uint32_t
rng
=
0
;
return
utils
::
cast_to_f8
<
half_t
,
f8_t
,
negative_zero_nan
,
clip
,
(
rm
==
f8_rounding_mode
::
stochastic
)
>
(
x
,
rng
);
#endif
}
...
...
@@ -224,21 +218,15 @@ inline __host__ __device__ bf8_t type_convert<bf8_t, half_t>(half_t x)
{
#if defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__)
// convert to float and use native converion
// return type_convert<bf8_t>(type_convert<float>(x));
std
::
ignore
=
x
;
const
f8_t
dummy
=
0
;
return
dummy
;
return
type_convert
<
bf8_t
>
(
type_convert
<
float
>
(
x
));
#else
// constexpr bool negative_zero_nan = true;
// constexpr bool clip = true;
// constexpr f8_rounding_mode rm = f8_rounding_mode::standard;
// constexpr uint32_t rng = 0;
// return utils::
// cast_to_f8<half_t, bf8_t, negative_zero_nan, clip, (rm == f8_rounding_mode::stochastic)>(
// x, rng);
std
::
ignore
=
x
;
const
bf8_t
dummy
=
0
;
return
dummy
;
constexpr
bool
negative_zero_nan
=
true
;
constexpr
bool
clip
=
true
;
constexpr
f8_rounding_mode
rm
=
f8_rounding_mode
::
standard
;
constexpr
uint32_t
rng
=
0
;
return
utils
::
cast_to_f8
<
half_t
,
bf8_t
,
negative_zero_nan
,
clip
,
(
rm
==
f8_rounding_mode
::
stochastic
)
>
(
x
,
rng
);
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment