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
287f7e9f
"driver/driver.cpp" did not exist on "1de6fd07535833877019634a95eafd329406be4c"
Commit
287f7e9f
authored
Feb 27, 2022
by
Shucai Xiao
Browse files
clang format
parent
b7d1ff95
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
src/include/migraphx/shape.hpp
src/include/migraphx/shape.hpp
+0
-1
src/targets/gpu/device/mul_add.cpp
src/targets/gpu/device/mul_add.cpp
+15
-14
No files found.
src/include/migraphx/shape.hpp
100755 → 100644
View file @
287f7e9f
...
@@ -227,7 +227,6 @@ struct shape
...
@@ -227,7 +227,6 @@ struct shape
private:
private:
std
::
shared_ptr
<
const
shape_impl
>
impl
;
std
::
shared_ptr
<
const
shape_impl
>
impl
;
};
};
void
migraphx_to_value
(
value
&
v
,
const
shape
&
s
);
void
migraphx_to_value
(
value
&
v
,
const
shape
&
s
);
...
...
src/targets/gpu/device/mul_add.cpp
View file @
287f7e9f
...
@@ -28,13 +28,12 @@ __global__ void mul_add_kernel(void* a, int an, void* x, int xn, void* b, int bn
...
@@ -28,13 +28,12 @@ __global__ void mul_add_kernel(void* a, int an, void* x, int xn, void* b, int bn
__half2
*
hb
=
reinterpret_cast
<
__half2
*>
(
b
);
__half2
*
hb
=
reinterpret_cast
<
__half2
*>
(
b
);
__half2
*
hx
=
reinterpret_cast
<
__half2
*>
(
x
);
__half2
*
hx
=
reinterpret_cast
<
__half2
*>
(
x
);
__half2
*
hr
=
reinterpret_cast
<
__half2
*>
(
r
);
__half2
*
hr
=
reinterpret_cast
<
__half2
*>
(
r
);
if
(
id
<
n
)
if
(
id
<
n
)
{
{
hr
[
id
]
=
__hadd2
(
__hmul2
(
ha
[
id
%
an
],
hx
[
id
%
xn
]),
hb
[
id
%
bn
]);
hr
[
id
]
=
__hadd2
(
__hmul2
(
ha
[
id
%
an
],
hx
[
id
%
xn
]),
hb
[
id
%
bn
]);
}
}
}
}
void
mul_add
(
hipStream_t
stream
,
void
mul_add
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg1
,
...
@@ -42,7 +41,7 @@ void mul_add(hipStream_t stream,
...
@@ -42,7 +41,7 @@ void mul_add(hipStream_t stream,
const
argument
&
arg3
)
const
argument
&
arg3
)
{
{
auto
type
=
result
.
get_shape
().
type
();
auto
type
=
result
.
get_shape
().
type
();
if
(
type
==
shape
::
half_type
)
if
(
type
==
shape
::
half_type
)
{
{
std
::
cout
<<
"case1"
<<
std
::
endl
;
std
::
cout
<<
"case1"
<<
std
::
endl
;
int
s1e
=
arg1
.
get_shape
().
element_space
()
/
2
;
int
s1e
=
arg1
.
get_shape
().
element_space
()
/
2
;
...
@@ -52,10 +51,12 @@ void mul_add(hipStream_t stream,
...
@@ -52,10 +51,12 @@ void mul_add(hipStream_t stream,
s1e
=
(
s1e
==
0
?
1
:
s1e
);
s1e
=
(
s1e
==
0
?
1
:
s1e
);
s2e
=
(
s2e
==
0
?
1
:
s2e
);
s2e
=
(
s2e
==
0
?
1
:
s2e
);
s3e
=
(
s3e
==
0
?
1
:
s3e
);
s3e
=
(
s3e
==
0
?
1
:
s3e
);
std
::
cout
<<
"re ="
<<
elem_num
<<
", s1e = "
<<
s1e
<<
", s2e = "
<<
s2e
<<
", s3e = "
<<
s3e
<<
std
::
endl
;
std
::
cout
<<
"re ="
<<
elem_num
<<
", s1e = "
<<
s1e
<<
", s2e = "
<<
s2e
<<
", s3e = "
<<
s3e
<<
std
::
endl
;
int
block_size
=
1024
;
int
block_size
=
1024
;
int
block_num
=
(
elem_num
+
block_size
-
1
)
/
block_size
;
int
block_num
=
(
elem_num
+
block_size
-
1
)
/
block_size
;
mul_add_kernel
<<<
block_num
,
block_size
>>>
(
arg1
.
data
(),
s1e
,
arg2
.
data
(),
s2e
,
arg3
.
data
(),
s3e
,
result
.
data
(),
elem_num
);
mul_add_kernel
<<<
block_num
,
block_size
>>>
(
arg1
.
data
(),
s1e
,
arg2
.
data
(),
s2e
,
arg3
.
data
(),
s3e
,
result
.
data
(),
elem_num
);
}
}
else
else
{
{
...
...
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