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
MIGraphX
Commits
fdc0ae82
Commit
fdc0ae82
authored
Mar 03, 2022
by
Shucai Xiao
Browse files
clang format
parent
6c834296
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/targets/gpu/device/gelu.cpp
src/targets/gpu/device/gelu.cpp
+5
-5
No files found.
src/targets/gpu/device/gelu.cpp
View file @
fdc0ae82
...
@@ -59,12 +59,12 @@ __global__ void add_gelu_kernel(void* a, void* b, int n_dim, void* r, int n)
...
@@ -59,12 +59,12 @@ __global__ void add_gelu_kernel(void* a, void* b, int n_dim, void* r, int n)
__half2
sqrt2
=
__float2half2_rn
(
M_SQRT1_2
);
__half2
sqrt2
=
__float2half2_rn
(
M_SQRT1_2
);
auto
x
=
__hmul2
(
sum
,
sqrt2
);
auto
x
=
__hmul2
(
sum
,
sqrt2
);
auto
f2
=
__half22float2
(
x
);
auto
f2
=
__half22float2
(
x
);
f2
.
x
=
::
erf
(
f2
.
x
);
f2
.
x
=
::
erf
(
f2
.
x
);
f2
.
y
=
::
erf
(
f2
.
y
);
f2
.
y
=
::
erf
(
f2
.
y
);
auto
h2
=
__floats2half2_rn
(
f2
.
x
,
f2
.
y
);
auto
h2
=
__floats2half2_rn
(
f2
.
x
,
f2
.
y
);
auto
one
=
__float2half2_rn
(
1.0
f
);
auto
one
=
__float2half2_rn
(
1.0
f
);
h2
=
__hadd2
(
h2
,
one
);
h2
=
__hadd2
(
h2
,
one
);
__half2
point5
=
__float2half2_rn
(
0.5
f
);
__half2
point5
=
__float2half2_rn
(
0.5
f
);
hr
[
tid
]
=
__hmul2
(
sum
,
__hmul2
(
point5
,
h2
));
hr
[
tid
]
=
__hmul2
(
sum
,
__hmul2
(
point5
,
h2
));
...
...
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