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
5eb53a4e
Commit
5eb53a4e
authored
Feb 07, 2022
by
Paul
Browse files
Formatting
parent
fb62d6ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
src/include/migraphx/stringutils.hpp
src/include/migraphx/stringutils.hpp
+2
-1
src/module.cpp
src/module.cpp
+7
-7
No files found.
src/include/migraphx/stringutils.hpp
View file @
5eb53a4e
...
...
@@ -21,7 +21,8 @@ auto with_char(F f)
return
[
=
](
unsigned
char
c
)
->
bool
{
return
f
(
c
);
};
}
inline
void
replace_string_inplace
(
std
::
string
&
subject
,
const
std
::
string
&
search
,
const
std
::
string
&
replace
)
inline
void
replace_string_inplace
(
std
::
string
&
subject
,
const
std
::
string
&
search
,
const
std
::
string
&
replace
)
{
size_t
pos
=
0
;
while
((
pos
=
subject
.
find
(
search
,
pos
))
!=
std
::
string
::
npos
)
...
...
src/module.cpp
100755 → 100644
View file @
5eb53a4e
...
...
@@ -678,7 +678,7 @@ void module::print_graph(std::ostream& os, bool brief) const
static
std
::
string
to_c_id
(
const
std
::
string
&
name
,
char
rep
=
'_'
)
{
std
::
string
id
=
transform_string
(
name
,
[
&
](
auto
c
)
{
if
(
with_char
(
::
isalnum
)(
c
)
or
c
==
'_'
)
if
(
with_char
(
::
isalnum
)(
c
)
or
c
==
'_'
)
return
c
;
return
rep
;
});
...
...
@@ -701,17 +701,17 @@ static std::string cpp_op_var(const std::string& name, instruction_ref ins)
static
void
print_value
(
std
::
ostream
&
os
,
const
value
&
v
)
{
if
(
not
v
.
get_key
().
empty
())
if
(
not
v
.
get_key
().
empty
())
{
os
<<
"{"
;
os
<<
enclose_name
(
v
.
get_key
())
<<
", "
;
print_value
(
os
,
v
.
without_key
());
os
<<
"}"
;
}
else
if
(
v
.
is_array
()
or
v
.
is_object
())
else
if
(
v
.
is_array
()
or
v
.
is_object
())
{
char
delim
=
'{'
;
for
(
const
auto
&
x
:
v
)
for
(
const
auto
&
x
:
v
)
{
os
<<
delim
;
delim
=
','
;
...
...
@@ -719,11 +719,11 @@ static void print_value(std::ostream& os, const value& v)
}
os
<<
"}"
;
}
else
if
(
v
.
is_null
())
else
if
(
v
.
is_null
())
{
os
<<
"nullptr"
;
}
else
if
(
v
.
is_string
())
else
if
(
v
.
is_string
())
{
os
<<
enclose_name
(
v
.
get_string
());
}
...
...
@@ -737,7 +737,7 @@ static void print_make_op(std::ostream& os, const operation& op)
{
os
<<
"migraphx::make_op("
<<
enclose_name
(
op
.
name
());
auto
v
=
op
.
to_value
();
if
(
not
v
.
empty
())
if
(
not
v
.
empty
())
{
print_value
(
os
,
v
);
}
...
...
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