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
fe91009b
"src/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "4cf9bd01d8f40600b4d9de13417c9a4f44f736d2"
Commit
fe91009b
authored
Aug 14, 2018
by
Paul
Browse files
Formatting
parent
03b1421c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
src/env.cpp
src/env.cpp
+2
-2
src/include/migraph/env.hpp
src/include/migraph/env.hpp
+10
-7
src/include/migraph/ranges.hpp
src/include/migraph/ranges.hpp
+4
-2
src/program.cpp
src/program.cpp
+2
-1
No files found.
src/env.cpp
View file @
fe91009b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
namespace
migraph
{
namespace
migraph
{
bool
enabled
(
const
char
*
name
)
bool
enabled
(
const
char
*
name
)
{
{
auto
e
=
env
(
name
);
auto
e
=
env
(
name
);
if
(
e
.
empty
())
if
(
e
.
empty
())
...
@@ -12,7 +12,7 @@ bool enabled(const char * name)
...
@@ -12,7 +12,7 @@ bool enabled(const char * name)
return
contains
({
"1"
,
"enable"
,
"enabled"
,
"yes"
,
"true"
},
e
.
front
());
return
contains
({
"1"
,
"enable"
,
"enabled"
,
"yes"
,
"true"
},
e
.
front
());
}
}
bool
disabled
(
const
char
*
name
)
bool
disabled
(
const
char
*
name
)
{
{
auto
e
=
env
(
name
);
auto
e
=
env
(
name
);
if
(
e
.
empty
())
if
(
e
.
empty
())
...
...
src/include/migraph/env.hpp
View file @
fe91009b
...
@@ -7,21 +7,24 @@
...
@@ -7,21 +7,24 @@
namespace
migraph
{
namespace
migraph
{
// Declare a cached environment variable
// Declare a cached environment variable
#define MIGRAPH_DECLARE_ENV_VAR(x) \
#define MIGRAPH_DECLARE_ENV_VAR(x) \
struct x { static const char* value() { return #x; } }; // NOLINT
struct x \
{ \
bool
enabled
(
const
char
*
name
);
static const char* value() { return #x; } \
bool
disabled
(
const
char
*
name
);
}; // NOLINT
bool
enabled
(
const
char
*
name
);
bool
disabled
(
const
char
*
name
);
std
::
vector
<
std
::
string
>
env
(
const
char
*
name
);
std
::
vector
<
std
::
string
>
env
(
const
char
*
name
);
template
<
class
T
>
template
<
class
T
>
bool
enabled
(
T
)
bool
enabled
(
T
)
{
{
static
const
bool
result
=
enabled
(
T
::
value
());
static
const
bool
result
=
enabled
(
T
::
value
());
return
result
;
return
result
;
}
}
template
<
class
T
>
template
<
class
T
>
bool
disabled
(
T
)
bool
disabled
(
T
)
{
{
static
const
bool
result
=
disabled
(
T
::
value
());
static
const
bool
result
=
disabled
(
T
::
value
());
...
...
src/include/migraph/ranges.hpp
View file @
fe91009b
...
@@ -22,8 +22,10 @@ template <class String, class T>
...
@@ -22,8 +22,10 @@ template <class String, class T>
auto
generic_find_impl
(
rank
<
2
>
,
String
&&
s
,
const
T
&
x
)
->
decltype
(
s
.
begin
()
+
s
.
find
(
x
),
s
.
npos
)
auto
generic_find_impl
(
rank
<
2
>
,
String
&&
s
,
const
T
&
x
)
->
decltype
(
s
.
begin
()
+
s
.
find
(
x
),
s
.
npos
)
{
{
auto
index
=
s
.
find
(
x
);
auto
index
=
s
.
find
(
x
);
if
(
index
==
s
.
npos
)
return
s
.
end
();
if
(
index
==
s
.
npos
)
else
return
s
.
begin
()
+
index
;
return
s
.
end
();
else
return
s
.
begin
()
+
index
;
}
}
template
<
class
C
,
class
T
>
template
<
class
C
,
class
T
>
...
...
src/program.cpp
View file @
fe91009b
...
@@ -187,7 +187,8 @@ void program::compile(const target& t)
...
@@ -187,7 +187,8 @@ void program::compile(const target& t)
assert
(
this
->
validate
()
==
impl
->
instructions
.
end
());
assert
(
this
->
validate
()
==
impl
->
instructions
.
end
());
this
->
impl
->
ctx
=
t
.
get_context
();
this
->
impl
->
ctx
=
t
.
get_context
();
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
std
::
cout
<<
*
this
<<
std
::
endl
<<
std
::
endl
;;
std
::
cout
<<
*
this
<<
std
::
endl
<<
std
::
endl
;
;
for
(
auto
&&
p
:
t
.
get_passes
(
this
->
impl
->
ctx
))
for
(
auto
&&
p
:
t
.
get_passes
(
this
->
impl
->
ctx
))
{
{
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
...
...
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