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
5e448d74
"vscode:/vscode.git/clone" did not exist on "05bbce8b0859a80a72ba29d35564d123eaea9ded"
Commit
5e448d74
authored
Mar 16, 2023
by
Rosty Geyyer
Browse files
Rearrange flag1
parent
725d97e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/ck/utility/data_type.hpp
include/ck/utility/data_type.hpp
+2
-2
No files found.
include/ck/utility/data_type.hpp
View file @
5e448d74
...
...
@@ -1000,10 +1000,10 @@ inline __host__ __device__ constexpr bhalf_t type_convert<bhalf_t, float>(float
// lower 16 bits of the mantissa are 1, we set the least significant bit
// of the bfloat16 mantissa, in order to preserve signaling NaN in case
// the bloat16's mantissa bits are all 0.
bool
flag1
=
u
.
int32
&
0xffff
;
bool
flag1
=
!
flag0
&&
(
u
.
int32
&
0xffff
)
;
u
.
int32
+=
flag0
?
0x7fff
+
((
u
.
int32
>>
16
)
&
1
)
:
0
;
// Round to nearest, round to even
u
.
int32
|=
(
!
flag0
&&
flag1
)
?
0x10000
:
0x0
;
// Preserve signaling NaN
u
.
int32
|=
flag1
?
0x10000
:
0x0
;
// Preserve signaling NaN
return
uint16_t
(
u
.
int32
>>
16
);
}
...
...
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