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
5ce4db2a
"test/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "7ee1c46b7831cdd5a66a46f23e4f32ffda1d0b52"
Commit
5ce4db2a
authored
Oct 25, 2023
by
Rostyslav Geyyer
Browse files
Fake the conversion
parent
27e6da87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
include/ck/utility/type_convert.hpp
include/ck/utility/type_convert.hpp
+28
-16
No files found.
include/ck/utility/type_convert.hpp
View file @
5ce4db2a
...
@@ -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
}
}
...
...
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