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
7460bab1
"git@developer.sourcefind.cn:gaoqiong/composable_kernel.git" did not exist on "83d9c3fb7e764e3065975fb4b504070d23bf4896"
Commit
7460bab1
authored
Feb 14, 2023
by
rocking
Browse files
Support fp16 sqrt for experiment
parent
ff5b6ea1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
include/ck/utility/math_v2.hpp
include/ck/utility/math_v2.hpp
+10
-0
No files found.
include/ck/utility/math_v2.hpp
View file @
7460bab1
...
...
@@ -83,6 +83,11 @@ static inline __host__ bool isnan(int4_t x)
};
#endif
static
inline
__host__
half_t
sqrt
(
half_t
x
)
{
return
static_cast
<
half_t
>
(
std
::
sqrt
(
static_cast
<
float
>
(
x
)));
};
static
inline
__host__
float
sqrt
(
float
x
)
{
return
std
::
sqrt
(
x
);
};
static
inline
__host__
double
sqrt
(
double
x
)
{
return
std
::
sqrt
(
x
);
};
...
...
@@ -158,6 +163,11 @@ static inline __device__ bool isnan(half_t x)
return
(
xx
&
0x7FFF
)
>
0x7C00
;
};
static
inline
__device__
half_t
sqrt
(
half_t
x
)
{
return
static_cast
<
half_t
>
(
__builtin_amdgcn_sqrtf
(
static_cast
<
float
>
(
x
)));
};
static
inline
__device__
float
sqrt
(
float
x
)
{
return
__builtin_amdgcn_sqrtf
(
x
);
};
static
inline
__device__
double
sqrt
(
double
x
)
{
return
__builtin_amdgcn_sqrt
(
x
);
};
...
...
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