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
710e2081
Commit
710e2081
authored
Apr 10, 2023
by
fsx950223
Browse files
use rtz
parent
a61aa740
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
include/ck/utility/data_type.hpp
include/ck/utility/data_type.hpp
+3
-9
No files found.
include/ck/utility/data_type.hpp
View file @
710e2081
...
@@ -964,22 +964,16 @@ inline __host__ __device__ constexpr float type_convert<float, bhalf_t>(bhalf_t
...
@@ -964,22 +964,16 @@ inline __host__ __device__ constexpr float type_convert<float, bhalf_t>(bhalf_t
return
u
.
fp32
;
return
u
.
fp32
;
}
}
// convert fp32 to bfp16
struct
uint16x2_t
{
ushort
x
;
ushort
y
;
};
template
<
>
template
<
>
inline
__host__
__device__
constexpr
bhalf_t
type_convert
<
bhalf_t
,
float
>
(
float
x
)
inline
__host__
__device__
constexpr
bhalf_t
type_convert
<
bhalf_t
,
float
>
(
float
x
)
{
{
union
union
{
{
float
fp32
;
float
fp32
;
uint
16x
2_t
int32
;
uint
3
2_t
int32
;
}
u
=
{
x
};
}
u
=
{
static_cast
<
float
>
(
x
)
};
return
u
.
int
32
.
y
+
(
u
.
int32
.
x
>>
1
5
);
return
uint
16_t
(
u
.
int32
>>
1
6
);
}
}
// convert fp16 to bf16
// convert fp16 to bf16
...
...
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