Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
dacfb9b8
Commit
dacfb9b8
authored
Aug 06, 2019
by
Shucai Xiao
Browse files
clang format
parent
9c172a77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
src/targets/gpu/include/migraphx/gpu/quant_convolution.hpp
src/targets/gpu/include/migraphx/gpu/quant_convolution.hpp
+1
-1
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+2
-3
src/targets/gpu/pack_int8_args.cpp
src/targets/gpu/pack_int8_args.cpp
+8
-5
No files found.
src/targets/gpu/include/migraphx/gpu/quant_convolution.hpp
View file @
dacfb9b8
...
@@ -36,7 +36,7 @@ struct miopen_quant_convolution
...
@@ -36,7 +36,7 @@ struct miopen_quant_convolution
return
shapes
.
size
()
-
1
;
return
shapes
.
size
()
-
1
;
}
}
private:
private:
shape
pack_int8_shape
(
const
shape
&
s
)
const
;
shape
pack_int8_shape
(
const
shape
&
s
)
const
;
};
};
...
...
src/targets/gpu/lowering.cpp
View file @
dacfb9b8
...
@@ -187,12 +187,11 @@ struct miopen_apply
...
@@ -187,12 +187,11 @@ struct miopen_apply
auto
conv
=
miopen_quant_convolution
{
op
,
make_conv
(
op
)};
auto
conv
=
miopen_quant_convolution
{
op
,
make_conv
(
op
)};
auto
ws
=
conv
.
compile
(
ctx
,
ins
->
get_shape
(),
to_shapes
(
ins
->
inputs
()));
auto
ws
=
conv
.
compile
(
ctx
,
ins
->
get_shape
(),
to_shapes
(
ins
->
inputs
()));
auto
args
=
ins
->
inputs
();
auto
args
=
ins
->
inputs
();
auto
workspace
=
insert_allocation
(
ins
,
ws
,
"workspace"
);
auto
workspace
=
insert_allocation
(
ins
,
ws
,
"workspace"
);
auto
output
=
insert_allocation
(
ins
,
ins
->
get_shape
());
auto
output
=
insert_allocation
(
ins
,
ins
->
get_shape
());
return
prog
->
replace_instruction
(
return
prog
->
replace_instruction
(
ins
,
conv
,
args
[
0
],
args
[
1
],
workspace
,
output
);
ins
,
conv
,
args
[
0
],
args
[
1
],
workspace
,
output
);
});
});
}
}
...
...
src/targets/gpu/pack_int8_args.cpp
View file @
dacfb9b8
...
@@ -39,12 +39,16 @@ void pack_int8_args::apply(program& p) const
...
@@ -39,12 +39,16 @@ void pack_int8_args::apply(program& p) const
else
if
(
ins
->
name
()
==
"gpu::quant_convolution"
)
else
if
(
ins
->
name
()
==
"gpu::quant_convolution"
)
{
{
auto
inputs
=
ins
->
inputs
();
auto
inputs
=
ins
->
inputs
();
auto
packed_x
=
p
.
insert_instruction
(
ins
,
hip_allocate
{
pack_int8_shape
(
inputs
[
0
]
->
get_shape
())});
auto
packed_x
=
auto
output_x
=
p
.
insert_instruction
(
ins
,
miopen_int8_conv_pack
{},
{
inputs
[
0
],
packed_x
});
p
.
insert_instruction
(
ins
,
hip_allocate
{
pack_int8_shape
(
inputs
[
0
]
->
get_shape
())});
auto
output_x
=
p
.
insert_instruction
(
ins
,
miopen_int8_conv_pack
{},
{
inputs
[
0
],
packed_x
});
instruction
::
replace_argument
(
ins
,
inputs
[
0
],
output_x
);
instruction
::
replace_argument
(
ins
,
inputs
[
0
],
output_x
);
auto
packed_w
=
p
.
insert_instruction
(
ins
,
hip_allocate
{
pack_int8_shape
(
inputs
[
1
]
->
get_shape
())});
auto
packed_w
=
auto
output_w
=
p
.
insert_instruction
(
ins
,
miopen_int8_conv_pack
{},
{
inputs
[
1
],
packed_w
});
p
.
insert_instruction
(
ins
,
hip_allocate
{
pack_int8_shape
(
inputs
[
1
]
->
get_shape
())});
auto
output_w
=
p
.
insert_instruction
(
ins
,
miopen_int8_conv_pack
{},
{
inputs
[
1
],
packed_w
});
instruction
::
replace_argument
(
ins
,
inputs
[
1
],
output_w
);
instruction
::
replace_argument
(
ins
,
inputs
[
1
],
output_w
);
}
}
}
}
...
@@ -65,7 +69,6 @@ shape pack_int8_args::pack_int8_shape(const shape& s) const
...
@@ -65,7 +69,6 @@ shape pack_int8_args::pack_int8_shape(const shape& s) const
return
{
s
.
type
(),
lens
,
strides
};
return
{
s
.
type
(),
lens
,
strides
};
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
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