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
55f47962
"...composable_kernel_rocm.git" did not exist on "6bbb94f455e601cb99d5494998e28f6e26a2620e"
Commit
55f47962
authored
Apr 30, 2019
by
Shucai Xiao
Browse files
minor changes to print out correct information
parent
69c5c485
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
src/include/migraphx/tensor_view.hpp
src/include/migraphx/tensor_view.hpp
+8
-2
src/targets/gpu/quant_gemm.cpp
src/targets/gpu/quant_gemm.cpp
+12
-5
No files found.
src/include/migraphx/tensor_view.hpp
View file @
55f47962
...
@@ -12,6 +12,12 @@
...
@@ -12,6 +12,12 @@
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
template
<
class
T
>
T
as_number
(
T
x
)
{
return
x
;
}
inline
int32_t
as_number
(
int8_t
x
)
{
return
static_cast
<
int32_t
>
(
x
);
}
inline
uint32_t
as_number
(
uint8_t
x
)
{
return
static_cast
<
uint8_t
>
(
x
);
}
template
<
class
T
>
template
<
class
T
>
struct
tensor_view
struct
tensor_view
{
{
...
@@ -130,10 +136,10 @@ struct tensor_view
...
@@ -130,10 +136,10 @@ struct tensor_view
{
{
if
(
!
x
.
empty
())
if
(
!
x
.
empty
())
{
{
os
<<
x
.
front
();
os
<<
as_number
(
x
.
front
()
)
;
for
(
std
::
size_t
i
=
1
;
i
<
x
.
m_shape
.
elements
();
i
++
)
for
(
std
::
size_t
i
=
1
;
i
<
x
.
m_shape
.
elements
();
i
++
)
{
{
os
<<
", "
<<
x
.
m_data
[
x
.
m_shape
.
index
(
i
)];
os
<<
", "
<<
as_number
(
x
.
m_data
[
x
.
m_shape
.
index
(
i
)]
)
;
}
}
}
}
return
os
;
return
os
;
...
...
src/targets/gpu/quant_gemm.cpp
View file @
55f47962
...
@@ -90,23 +90,30 @@ argument miopen_quant_gemm::compute(context& ctx,
...
@@ -90,23 +90,30 @@ argument miopen_quant_gemm::compute(context& ctx,
assert
(
transa
or
(
lda
%
4
==
0
));
assert
(
transa
or
(
lda
%
4
==
0
));
assert
(
!
transb
or
(
ldb
%
4
==
0
));
assert
(
!
transb
or
(
ldb
%
4
==
0
));
auto
arg_0
=
migraphx
::
gpu
::
from_gpu
(
args
[
0
]);
auto
arg_1
=
migraphx
::
gpu
::
from_gpu
(
args
[
1
]);
auto
arg_2
=
migraphx
::
gpu
::
from_gpu
(
args
[
2
]);
std
::
cout
<<
"arg_0 = "
<<
arg_0
<<
std
::
endl
;
std
::
cout
<<
"arg_1 = "
<<
arg_1
<<
std
::
endl
;
std
::
cout
<<
"arg_2 = "
<<
arg_2
<<
std
::
endl
;
auto
num_matrices
=
std
::
accumulate
(
auto
num_matrices
=
std
::
accumulate
(
out_lens
.
rbegin
()
+
2
,
out_lens
.
rend
(),
std
::
size_t
{
1
},
std
::
multiplies
<
std
::
size_t
>
());
out_lens
.
rbegin
()
+
2
,
out_lens
.
rend
(),
std
::
size_t
{
1
},
std
::
multiplies
<
std
::
size_t
>
());
if
(
num_matrices
==
1
)
if
(
num_matrices
==
1
)
{
{
generic_rocblas_gemm_ex
(
ctx
.
get_stream
().
get_rocblas
(),
generic_rocblas_gemm_ex
(
ctx
.
get_stream
().
get_rocblas
(),
transb
?
rocblas_operation_transpose
:
rocblas_operation_none
,
transa
?
rocblas_operation_transpose
:
rocblas_operation_none
,
transa
?
rocblas_operation_transpose
:
rocblas_operation_none
,
n
,
transb
?
rocblas_operation_transpose
:
rocblas_operation_none
,
m
,
m
,
n
,
k
,
k
,
&
alpha_r
,
&
alpha_r
,
to_pointer
(
args
[
1
]),
rocblas_datatype_i8_r
,
ldb
,
to_pointer
(
args
[
0
]),
to_pointer
(
args
[
0
]),
rocblas_datatype_i8_r
,
rocblas_datatype_i8_r
,
lda
,
lda
,
to_pointer
(
args
[
1
]),
rocblas_datatype_i8_r
,
ldb
,
&
beta_r
,
&
beta_r
,
to_pointer
(
args
[
2
]),
to_pointer
(
args
[
2
]),
rocblas_datatype_i32_r
,
rocblas_datatype_i32_r
,
...
...
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