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
ee157fc2
Commit
ee157fc2
authored
Jun 04, 2019
by
Shucai Xiao
Browse files
clang format
parent
870f565e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
49 deletions
+49
-49
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+1
-1
src/targets/gpu/quant_convolution.cpp
src/targets/gpu/quant_convolution.cpp
+2
-2
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+46
-46
No files found.
src/targets/gpu/lowering.cpp
View file @
ee157fc2
...
...
@@ -171,7 +171,7 @@ struct miopen_apply
// add a temp float output to store the miopen convolution output
shape
tmp_output_shape
{
shape
::
float_type
,
ins
->
get_shape
().
lens
()};
auto
tmp_output
=
insert_allocation
(
ins
,
tmp_output_shape
,
"tmp_out"
);
auto
output
=
insert_allocation
(
ins
,
ins
->
get_shape
());
auto
output
=
insert_allocation
(
ins
,
ins
->
get_shape
());
return
prog
->
replace_instruction
(
ins
,
conv
,
ins
->
inputs
().
at
(
0
),
ins
->
inputs
().
at
(
1
),
workspace
,
tmp_output
,
output
);
...
...
src/targets/gpu/quant_convolution.cpp
View file @
ee157fc2
...
...
@@ -21,7 +21,7 @@ argument miopen_quant_convolution::compute(context& ctx,
auto
w_desc
=
make_tensor
(
args
[
1
].
get_shape
());
auto
w_desc_vec4
=
make_tensor
(
args
[
1
].
get_shape
(),
true
);
shape
tmp_output_shape
{
shape
::
float_type
,
output_shape
.
lens
()};
auto
y_desc
=
make_tensor
(
tmp_output_shape
);
auto
y_desc
=
make_tensor
(
tmp_output_shape
);
float
alpha
=
1
;
float
beta
=
0
;
...
...
@@ -72,7 +72,7 @@ argument miopen_quant_convolution::compute(context& ctx,
// Add a conversion from float to int32_t
device
::
convert
(
ctx
.
get_stream
().
get
(),
args
[
4
],
args
[
3
]);
return
args
[
4
];
}
...
...
test/cpu_ops_test.cpp
View file @
ee157fc2
...
...
@@ -1318,21 +1318,21 @@ TEST_CASE(quant_conv2d_test)
auto
result
=
p
.
eval
({});
std
::
vector
<
int32_t
>
s
=
{
10197
,
10548
,
11601
,
11952
,
25506
,
26586
,
29826
,
30906
,
27045
,
27396
,
28449
,
28800
,
77346
,
78426
,
81666
,
82746
};
10548
,
11601
,
11952
,
25506
,
26586
,
29826
,
30906
,
27045
,
27396
,
28449
,
28800
,
77346
,
78426
,
81666
,
82746
};
std
::
vector
<
int32_t
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
...
...
@@ -1388,21 +1388,21 @@ TEST_CASE(quant_conv2d_test_valid_mode)
auto
result
=
p
.
eval
({});
std
::
vector
<
int32_t
>
s
=
{
10197
,
10548
,
11601
,
11952
,
25506
,
26586
,
29826
,
30906
,
27045
,
27396
,
28449
,
28800
,
77346
,
78426
,
81666
,
82746
};
10548
,
11601
,
11952
,
25506
,
26586
,
29826
,
30906
,
27045
,
27396
,
28449
,
28800
,
77346
,
78426
,
81666
,
82746
};
std
::
vector
<
int32_t
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
...
...
@@ -1422,7 +1422,7 @@ TEST_CASE(quant_conv2d_padding_test)
auto
cl
=
p
.
add_literal
(
migraphx
::
literal
{
c_shape
,
c
});
p
.
add_instruction
(
migraphx
::
op
::
quant_convolution
{{{
1
,
1
}},
{{
1
,
1
}}},
al
,
cl
);
p
.
compile
(
migraphx
::
cpu
::
target
{});
auto
result
=
p
.
eval
({});
auto
result
=
p
.
eval
({});
std
::
vector
<
int32_t
>
s
=
{
4521
,
6753
,
7014
,
4635
,
6858
,
10197
,
10548
,
6939
,
7830
,
11601
,
11952
,
7839
,
5007
,
7383
,
7590
,
4953
,
10515
,
15987
,
16734
,
11277
,
16821
,
25506
,
26586
,
17874
,
19737
,
29826
,
...
...
@@ -1451,21 +1451,21 @@ TEST_CASE(quant_conv2d_padding_stride_test)
auto
result
=
p
.
eval
({});
std
::
vector
<
int32_t
>
s
=
{
4521
,
7014
,
7830
,
11952
,
10515
,
16734
,
19737
,
30906
,
13161
,
19542
,
19494
,
28800
,
34707
,
52590
,
54729
,
82746
};
7014
,
7830
,
11952
,
10515
,
16734
,
19737
,
30906
,
13161
,
19542
,
19494
,
28800
,
34707
,
52590
,
54729
,
82746
};
std
::
vector
<
int32_t
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
EXPECT
(
migraphx
::
verify_range
(
results_vector
,
s
));
...
...
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