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
d79346d1
Commit
d79346d1
authored
Nov 05, 2018
by
Shucai Xiao
Browse files
Added inline namespace for all .hpp and .cpp file.
parent
7d972d2b
Changes
134
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
61 additions
and
12 deletions
+61
-12
src/auto_contiguous.cpp
src/auto_contiguous.cpp
+2
-0
src/common_subexpression_elimination.cpp
src/common_subexpression_elimination.cpp
+2
-0
src/constant_propagate.cpp
src/constant_propagate.cpp
+2
-0
src/dead_code_elimination.cpp
src/dead_code_elimination.cpp
+2
-0
src/eliminate_allocation.cpp
src/eliminate_allocation.cpp
+3
-0
src/eliminate_contiguous.cpp
src/eliminate_contiguous.cpp
+2
-0
src/env.cpp
src/env.cpp
+2
-0
src/fwd_conv_batchnorm_rewrite.cpp
src/fwd_conv_batchnorm_rewrite.cpp
+4
-0
src/generate.cpp
src/generate.cpp
+2
-1
src/include/migraph/argument.hpp
src/include/migraph/argument.hpp
+3
-1
src/include/migraph/auto_any_cast.hpp
src/include/migraph/auto_any_cast.hpp
+3
-1
src/include/migraph/auto_contiguous.hpp
src/include/migraph/auto_contiguous.hpp
+3
-1
src/include/migraph/builtin.hpp
src/include/migraph/builtin.hpp
+3
-2
src/include/migraph/check_context.hpp
src/include/migraph/check_context.hpp
+3
-1
src/include/migraph/check_shapes.hpp
src/include/migraph/check_shapes.hpp
+3
-1
src/include/migraph/common_subexpression_elimination.hpp
src/include/migraph/common_subexpression_elimination.hpp
+3
-1
src/include/migraph/config.hpp
src/include/migraph/config.hpp
+10
-0
src/include/migraph/constant_propagate.hpp
src/include/migraph/constant_propagate.hpp
+3
-1
src/include/migraph/context.hpp
src/include/migraph/context.hpp
+3
-1
src/include/migraph/dead_code_elimination.hpp
src/include/migraph/dead_code_elimination.hpp
+3
-1
No files found.
src/auto_contiguous.cpp
View file @
d79346d1
...
...
@@ -5,6 +5,7 @@
#include <migraph/iterator_for.hpp>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
void
auto_contiguous
::
apply
(
program
&
p
)
const
{
...
...
@@ -19,4 +20,5 @@ void auto_contiguous::apply(program& p) const
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/common_subexpression_elimination.cpp
View file @
d79346d1
...
...
@@ -8,6 +8,7 @@
#include <unordered_set>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
template
<
class
Range
>
void
cse_range
(
program
&
p
,
Range
&&
r
)
...
...
@@ -34,4 +35,5 @@ void cse_range(program& p, Range&& r)
void
common_subexpression_elimination
::
apply
(
program
&
p
)
const
{
cse_range
(
p
,
iterator_for
(
p
));
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/constant_propagate.cpp
View file @
d79346d1
...
...
@@ -4,6 +4,7 @@
#include <migraph/literal.hpp>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
struct
match_const_add
{
...
...
@@ -25,4 +26,5 @@ struct match_const_add
void
constant_propagate
::
apply
(
program
&
p
)
const
{
match
::
find_matches
(
p
,
match_const_add
{});
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/dead_code_elimination.cpp
View file @
d79346d1
...
...
@@ -6,6 +6,7 @@
#include <migraph/ranges.hpp>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
template
<
class
Range
,
class
Iterator
>
std
::
ptrdiff_t
bidistance
(
const
Range
&
r
,
Iterator
start
,
Iterator
last
)
...
...
@@ -61,4 +62,5 @@ void dead_code_elimination::apply(program& p) const
p
.
remove_instructions
(
std
::
next
(
last
),
p
.
end
());
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/eliminate_allocation.cpp
View file @
d79346d1
...
...
@@ -8,6 +8,7 @@
#include <migraph/pass_config.hpp>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
void
eliminate_allocation
::
apply
(
program
&
p
)
const
{
...
...
@@ -35,4 +36,6 @@ void eliminate_allocation::apply(program& p) const
p
.
replace_instruction
(
ins
,
op
::
load
{
s
,
offset
},
mem
);
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/eliminate_contiguous.cpp
View file @
d79346d1
...
...
@@ -8,6 +8,7 @@
#include <utility>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
bool
try_compute_shape
(
const
operation
&
op
,
const
std
::
vector
<
instruction_ref
>&
args
)
{
...
...
@@ -46,4 +47,5 @@ void eliminate_contiguous::apply(program& p) const
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/env.cpp
View file @
d79346d1
...
...
@@ -3,6 +3,7 @@
#include <cstdlib>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
bool
enabled
(
const
char
*
name
)
{
...
...
@@ -29,4 +30,5 @@ std::vector<std::string> env(const char* name)
return
{{
p
}};
}
}
// namespace MIGRAPH_INLINE_N
}
// namespace migraph
src/fwd_conv_batchnorm_rewrite.cpp
View file @
d79346d1
...
...
@@ -6,6 +6,8 @@
#include <migraph/dfor.hpp>
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
void
fwd_conv_batchnorm_rewrite
::
apply
(
program
&
p
)
const
{
for
(
auto
ins
:
iterator_for
(
p
))
...
...
@@ -64,4 +66,6 @@ void fwd_conv_batchnorm_rewrite::apply(program& p) const
p
.
replace_instruction
(
ins
,
op
::
add
{},
{
c
,
b
});
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/generate.cpp
View file @
d79346d1
#include <migraph/generate.hpp>
namespace
migraph
{
namespace
migraph
{
namespace
MIGRAPH_INLINE_NS
{
argument
generate_argument
(
shape
s
,
unsigned
long
seed
)
{
...
...
@@ -30,4 +30,5 @@ literal abs(literal l)
return
transform
(
std
::
move
(
l
),
[](
auto
x
)
{
return
std
::
fabs
(
x
);
});
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/include/migraph/argument.hpp
View file @
d79346d1
...
...
@@ -3,10 +3,11 @@
#include <migraph/shape.hpp>
#include <migraph/raw_data.hpp>
#include <migraph/config.hpp>
#include <functional>
#include <utility>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
/**
* @brief Arguments passed to instructions
...
...
@@ -45,6 +46,7 @@ struct argument : raw_data<argument>
shape
m_shape
;
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/auto_any_cast.hpp
View file @
d79346d1
#ifndef MIGRAPH_GUARD_RTGLIB_AUTO_ANY_CAST_HPP
#define MIGRAPH_GUARD_RTGLIB_AUTO_ANY_CAST_HPP
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
detail
{
...
...
@@ -32,6 +33,7 @@ detail::auto_any_caster<T> auto_any_cast(T& x)
return
{
x
};
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/auto_contiguous.hpp
View file @
d79346d1
...
...
@@ -3,8 +3,9 @@
#include <string>
#include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -14,6 +15,7 @@ struct auto_contiguous
void
apply
(
program
&
p
)
const
;
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/builtin.hpp
View file @
d79346d1
...
...
@@ -5,8 +5,9 @@
#include <migraph/errors.hpp>
#include <migraph/argument.hpp>
#include <migraph/reflect.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
builtin
{
...
...
@@ -62,7 +63,7 @@ struct param
};
}
// namespace builtin
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/check_context.hpp
View file @
d79346d1
...
...
@@ -2,8 +2,9 @@
#define MIGRAPH_GUARD_RTGLIB_CHECK_CONTEXT_HPP
#include <migraph/program.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
T
>
struct
check_context
...
...
@@ -25,6 +26,7 @@ struct check_context
void
apply
(
program
&
p
)
const
{
p
.
insert_instruction
(
p
.
begin
(),
op
{});
}
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/check_shapes.hpp
View file @
d79346d1
...
...
@@ -2,9 +2,10 @@
#define MIGRAPH_GUARD_RTGLIB_CHECK_SHAPES_HPP
#include <migraph/shape.hpp>
#include <migraph/config.hpp>
#include <algorithm>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
check_shapes
{
...
...
@@ -154,6 +155,7 @@ struct check_shapes
check_shapes
slice
(
long
start
,
long
last
)
{
return
{
get
(
start
),
get
(
last
),
name
};
}
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/common_subexpression_elimination.hpp
View file @
d79346d1
...
...
@@ -3,8 +3,9 @@
#include <string>
#include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -14,6 +15,7 @@ struct common_subexpression_elimination
void
apply
(
program
&
p
)
const
;
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/config.hpp
0 → 100644
View file @
d79346d1
#ifndef MIGRAPH_GUARD_CONFIG_HPP
#define MIGRAPH_GUARD_CONFIG_HPP
namespace
migraph
{
#define MIGRAPH_INLINE_NS version_1
}
// namespace migraph
#endif
src/include/migraph/constant_propagate.hpp
View file @
d79346d1
...
...
@@ -2,8 +2,9 @@
#define MIGRAPH_GUARD_RTGLIB_CONSTANT_PROPAGATE_HPP
#include <string>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -13,6 +14,7 @@ struct constant_propagate
void
apply
(
program
&
p
)
const
;
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/context.hpp
View file @
d79346d1
...
...
@@ -7,8 +7,9 @@
#include <memory>
#include <type_traits>
#include <utility>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
#ifdef DOXYGEN
...
...
@@ -203,6 +204,7 @@ inline const ValueType& any_cast(const context& x)
#endif
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/dead_code_elimination.hpp
View file @
d79346d1
...
...
@@ -3,8 +3,9 @@
#include <string>
#include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -14,6 +15,7 @@ struct dead_code_elimination
void
apply
(
program
&
p
)
const
;
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
Prev
1
2
3
4
5
…
7
Next
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