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
1e5f7133
Commit
1e5f7133
authored
May 06, 2022
by
Paul
Browse files
Format
parent
84d5e2b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/targets/gpu/gemm_impl.cpp
src/targets/gpu/gemm_impl.cpp
+8
-8
No files found.
src/targets/gpu/gemm_impl.cpp
View file @
1e5f7133
...
@@ -30,17 +30,17 @@ rocblas_datatype get_type(shape::type_t type)
...
@@ -30,17 +30,17 @@ rocblas_datatype get_type(shape::type_t type)
void
blas_shape
(
const
shape
&
s
)
void
blas_shape
(
const
shape
&
s
)
{
{
if
(
s
.
lens
().
size
()
<
2
)
if
(
s
.
lens
().
size
()
<
2
)
return
;
return
;
if
(
std
::
none_of
(
s
.
strides
().
end
()
-
2
,
s
.
strides
().
end
(),
[
&
](
auto
i
)
{
if
(
std
::
none_of
(
s
.
strides
().
end
()
-
2
,
s
.
strides
().
end
(),
[
&
](
auto
i
)
{
return
i
==
1
;
}))
return
i
==
1
;
}))
MIGRAPHX_THROW
(
"GPU_GEMM: needs to have one matrix stride as 1"
);
MIGRAPHX_THROW
(
"GPU_GEMM: needs to have one matrix stride as 1"
);
if
(
s
.
lens
().
size
()
<
3
)
if
(
s
.
lens
().
size
()
<
3
)
return
;
return
;
shape
batch_shape
{
s
.
type
(),
{
s
.
lens
().
begin
(),
s
.
lens
().
end
()
-
2
},
{
s
.
strides
().
begin
(),
s
.
strides
().
end
()
-
2
}};
shape
batch_shape
{
s
.
type
(),
{
s
.
lens
().
begin
(),
s
.
lens
().
end
()
-
2
},
{
s
.
strides
().
begin
(),
s
.
strides
().
end
()
-
2
}};
auto
batch_shapes
=
reduce_dims
({
batch_shape
});
auto
batch_shapes
=
reduce_dims
({
batch_shape
});
if
(
batch_shapes
.
front
().
lens
().
size
()
!=
1
)
if
(
batch_shapes
.
front
().
lens
().
size
()
!=
1
)
MIGRAPHX_THROW
(
"GPU_GEMM: Batch dimension is not collapsible"
);
MIGRAPHX_THROW
(
"GPU_GEMM: Batch dimension is not collapsible"
);
}
}
...
@@ -55,7 +55,7 @@ R rocblas_invoke(R (*f)(Ts...), Us... xs)
...
@@ -55,7 +55,7 @@ R rocblas_invoke(R (*f)(Ts...), Us... xs)
static
bool
is_transposed
(
const
shape
&
s
)
static
bool
is_transposed
(
const
shape
&
s
)
{
{
if
(
not
s
.
transposed
())
if
(
not
s
.
transposed
())
return
false
;
return
false
;
return
s
.
strides
().
back
()
!=
1
;
return
s
.
strides
().
back
()
!=
1
;
}
}
...
...
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