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
ab0b8b80
Commit
ab0b8b80
authored
May 24, 2019
by
Shucai Xiao
Browse files
fix cpp check errors.
parent
702eeb45
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
11 deletions
+26
-11
src/targets/gpu/include/migraphx/gpu/quant_convolution.hpp
src/targets/gpu/include/migraphx/gpu/quant_convolution.hpp
+1
-1
src/targets/gpu/include/migraphx/gpu/quant_gemm.hpp
src/targets/gpu/include/migraphx/gpu/quant_gemm.hpp
+6
-2
src/targets/gpu/quant_gemm.cpp
src/targets/gpu/quant_gemm.cpp
+19
-8
No files found.
src/targets/gpu/include/migraphx/gpu/quant_convolution.hpp
View file @
ab0b8b80
...
@@ -33,7 +33,7 @@ struct miopen_quant_convolution
...
@@ -33,7 +33,7 @@ struct miopen_quant_convolution
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
;
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
;
shape
compile
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
shape
>
inputs
);
shape
compile
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
shape
>
inputs
);
void
finalize
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
shape
>
inputs
);
void
finalize
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
shape
>
inputs
);
in
t
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
std
::
ptrdiff_
t
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
private:
private:
shape
pack_int8_shape
(
shape
&
s
);
shape
pack_int8_shape
(
shape
&
s
);
...
...
src/targets/gpu/include/migraphx/gpu/quant_gemm.hpp
View file @
ab0b8b80
...
@@ -13,8 +13,8 @@ struct context;
...
@@ -13,8 +13,8 @@ struct context;
struct
miopen_quant_gemm
struct
miopen_quant_gemm
{
{
op
::
quant_dot
op
;
op
::
quant_dot
op
;
mutable
argument
arg_a
{};
m
utable
argument
arg_b
{}
;
m
iopen_quant_gemm
(
op
::
quant_dot
qop
)
:
op
(
qop
)
{}
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
static
auto
reflect
(
Self
&
self
,
F
f
)
...
@@ -30,6 +30,10 @@ struct miopen_quant_gemm
...
@@ -30,6 +30,10 @@ struct miopen_quant_gemm
{
{
return
shapes
.
size
()
-
1
;
return
shapes
.
size
()
-
1
;
}
}
private:
mutable
argument
arg_a
;
mutable
argument
arg_b
;
};
};
}
// namespace gpu
}
// namespace gpu
...
...
src/targets/gpu/quant_gemm.cpp
View file @
ab0b8b80
...
@@ -57,6 +57,25 @@ shape miopen_quant_gemm::compute_shape(const std::vector<shape>& inputs) const
...
@@ -57,6 +57,25 @@ shape miopen_quant_gemm::compute_shape(const std::vector<shape>& inputs) const
std
::
vector
<
shape
>
input_shapes
(
inputs
);
std
::
vector
<
shape
>
input_shapes
(
inputs
);
input_shapes
.
pop_back
();
input_shapes
.
pop_back
();
check_shapes
{
input_shapes
}.
not_broadcasted
();
check_shapes
{
input_shapes
}.
not_broadcasted
();
bool
transa
=
inputs
[
0
].
transposed
();
bool
transb
=
inputs
[
1
].
transposed
();
if
(
!
transb
)
{
if
(
arg_b
.
empty
())
{
arg_b
=
allocate_gpu
(
inputs
[
1
]);
}
}
if
(
transa
)
{
if
(
arg_a
.
empty
())
{
arg_a
=
allocate_gpu
(
inputs
[
0
]);
}
}
return
op
.
compute_shape
(
input_shapes
);
return
op
.
compute_shape
(
input_shapes
);
}
}
...
@@ -75,10 +94,6 @@ argument miopen_quant_gemm::compute(context& ctx,
...
@@ -75,10 +94,6 @@ argument miopen_quant_gemm::compute(context& ctx,
if
(
!
transb
)
if
(
!
transb
)
{
{
if
(
arg_b
.
empty
())
{
arg_b
=
allocate_gpu
(
args
[
1
].
get_shape
());
}
device
::
pack_a
(
ctx
.
get_stream
().
get
(),
arg_b
,
args
[
1
]);
device
::
pack_a
(
ctx
.
get_stream
().
get
(),
arg_b
,
args
[
1
]);
}
}
...
@@ -86,10 +101,6 @@ argument miopen_quant_gemm::compute(context& ctx,
...
@@ -86,10 +101,6 @@ argument miopen_quant_gemm::compute(context& ctx,
// comment of the API
// comment of the API
if
(
transa
)
if
(
transa
)
{
{
if
(
arg_a
.
empty
())
{
arg_a
=
allocate_gpu
(
args
.
at
(
0
).
get_shape
());
}
device
::
pack_b
(
ctx
.
get_stream
().
get
(),
arg_a
,
args
[
0
]);
device
::
pack_b
(
ctx
.
get_stream
().
get
(),
arg_a
,
args
[
0
]);
}
}
...
...
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