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
d5ef3394
Commit
d5ef3394
authored
Apr 28, 2023
by
Paul
Browse files
Format
parent
9aa3f5d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
src/common_dims.cpp
src/common_dims.cpp
+6
-17
No files found.
src/common_dims.cpp
View file @
d5ef3394
...
@@ -33,24 +33,13 @@ static auto elements(const Range& r)
...
@@ -33,24 +33,13 @@ static auto elements(const Range& r)
struct
common_dim_state
struct
common_dim_state
{
{
common_dim_state
(
const
std
::
vector
<
std
::
size_t
>&
pdims
)
common_dim_state
(
const
std
::
vector
<
std
::
size_t
>&
pdims
)
:
dims
(
&
pdims
),
it
(
dims
->
begin
())
{}
:
dims
(
&
pdims
),
it
(
dims
->
begin
())
{}
const
std
::
vector
<
std
::
size_t
>*
dims
;
const
std
::
vector
<
std
::
size_t
>*
dims
;
std
::
vector
<
std
::
size_t
>::
const_iterator
it
;
std
::
vector
<
std
::
size_t
>::
const_iterator
it
;
std
::
size_t
rem
=
1
;
std
::
size_t
rem
=
1
;
std
::
size_t
get
()
const
std
::
size_t
get
()
const
{
return
*
it
;
}
{
bool
is_end
()
const
{
return
it
==
dims
->
end
();
}
return
*
it
;
void
next
(
std
::
size_t
i
=
1
)
{
it
+=
i
;
}
}
bool
is_end
()
const
{
return
it
==
dims
->
end
();
}
void
next
(
std
::
size_t
i
=
1
)
{
it
+=
i
;
}
auto
dims_for
(
std
::
size_t
d
)
const
auto
dims_for
(
std
::
size_t
d
)
const
{
{
auto
dim_end
=
compute_end_dim
(
it
,
dims
->
end
(),
d
);
auto
dim_end
=
compute_end_dim
(
it
,
dims
->
end
(),
d
);
...
@@ -58,8 +47,8 @@ struct common_dim_state
...
@@ -58,8 +47,8 @@ struct common_dim_state
}
}
}
}
common_dims
common_dims
::
compute
(
const
std
::
vector
<
std
::
size_t
>&
dims1
,
common_dims
const
std
::
vector
<
std
::
size_t
>&
dims2
)
common_dims
::
compute
(
const
std
::
vector
<
std
::
size_t
>&
dims1
,
const
std
::
vector
<
std
::
size_t
>&
dims2
)
{
{
assert
(
elements
(
dims1
)
==
elements
(
dims2
));
assert
(
elements
(
dims1
)
==
elements
(
dims2
));
common_dims
cd
;
common_dims
cd
;
...
...
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