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
872093b7
Commit
872093b7
authored
May 11, 2023
by
Rostyslav Geyyer
Browse files
Format
parent
5038b95b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
include/ck/utility/data_type.hpp
include/ck/utility/data_type.hpp
+9
-9
No files found.
include/ck/utility/data_type.hpp
View file @
872093b7
...
...
@@ -1099,8 +1099,7 @@ __host__ __device__ uint8_t cast_to_f8(float x, uint32_t rng)
uint32_t
drop_mask
=
(
1
<<
(
wm_f32
-
wm_f8
))
-
1
;
const
int
max_exp
=
(
1
<<
we_f8
)
-
(
negative_zero_nan
?
1
:
2
);
const
int
exp_low_cutoff
=
0x80
-
(
1
<<
(
we_f8
-
1
))
+
1
-
(
negative_zero_nan
?
1
:
0
);
const
int
exp_low_cutoff
=
0x80
-
(
1
<<
(
we_f8
-
1
))
+
1
-
(
negative_zero_nan
?
1
:
0
);
exponent
-=
exp_low_cutoff
-
1
;
if
(
exponent
<=
0
)
...
...
@@ -1200,7 +1199,8 @@ __host__ __device__ float cast_from_f8(uint8_t x)
}
uint32_t
retval
;
const
int
exp_low_cutoff
=
(
1
<<
(
we_f32
-
1
))
-
(
1
<<
(
we_f8
-
1
))
+
1
-
(
negative_zero_nan
?
1
:
0
);
const
int
exp_low_cutoff
=
(
1
<<
(
we_f32
-
1
))
-
(
1
<<
(
we_f8
-
1
))
+
1
-
(
negative_zero_nan
?
1
:
0
);
// subnormal input
if
(
exponent
==
0
)
...
...
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