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
c0bcc6fc
Unverified
Commit
c0bcc6fc
authored
Nov 06, 2018
by
Paul Fultz II
Committed by
GitHub
Nov 06, 2018
Browse files
Merge pull request #106 from ROCmSoftwarePlatform/inlinenamespace
Inlinenamespace
parents
7d972d2b
7d4e672c
Changes
138
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
58 additions
and
2 deletions
+58
-2
src/include/migraph/stringutils.hpp
src/include/migraph/stringutils.hpp
+3
-0
src/include/migraph/target.hpp
src/include/migraph/target.hpp
+3
-0
src/include/migraph/tensor_view.hpp
src/include/migraph/tensor_view.hpp
+3
-0
src/include/migraph/time.hpp
src/include/migraph/time.hpp
+3
-0
src/include/migraph/tracer.hpp
src/include/migraph/tracer.hpp
+3
-0
src/include/migraph/type_name.hpp
src/include/migraph/type_name.hpp
+3
-0
src/include/migraph/type_traits.hpp
src/include/migraph/type_traits.hpp
+3
-0
src/include/migraph/verify.hpp
src/include/migraph/verify.hpp
+4
-0
src/include/migraph/verify_args.hpp
src/include/migraph/verify_args.hpp
+3
-0
src/instruction.cpp
src/instruction.cpp
+2
-0
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+3
-1
src/opt/common_header.hpp
src/opt/common_header.hpp
+4
-0
src/opt/memory_coloring.cpp
src/opt/memory_coloring.cpp
+3
-0
src/opt/memory_coloring_impl.cpp
src/opt/memory_coloring_impl.cpp
+3
-0
src/opt/memory_coloring_impl.hpp
src/opt/memory_coloring_impl.hpp
+4
-0
src/program.cpp
src/program.cpp
+3
-0
src/shape.cpp
src/shape.cpp
+2
-0
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+2
-0
src/simplify_reshapes.cpp
src/simplify_reshapes.cpp
+2
-0
src/targets/cpu/gemm.cpp
src/targets/cpu/gemm.cpp
+2
-1
No files found.
src/include/migraph/stringutils.hpp
View file @
c0bcc6fc
...
...
@@ -5,8 +5,10 @@
#include <numeric>
#include <string>
#include <sstream>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
std
::
string
replace_string
(
std
::
string
subject
,
const
std
::
string
&
search
,
const
std
::
string
&
replace
)
...
...
@@ -85,6 +87,7 @@ inline std::string to_string(const T& x)
return
ss
.
str
();
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/target.hpp
View file @
c0bcc6fc
...
...
@@ -10,8 +10,10 @@
#include <vector>
#include <migraph/context.hpp>
#include <migraph/pass.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
#ifdef DOXYGEN
...
...
@@ -242,6 +244,7 @@ inline const ValueType& any_cast(const target& x)
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/tensor_view.hpp
View file @
c0bcc6fc
...
...
@@ -4,11 +4,13 @@
#include <migraph/shape.hpp>
#include <migraph/float_equal.hpp>
#include <migraph/requires.hpp>
#include <migraph/config.hpp>
#include <iostream>
#include <utility>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
T
>
struct
tensor_view
...
...
@@ -167,6 +169,7 @@ tensor_view<T> make_view(shape s, T* data)
return
{
s
,
data
};
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/time.hpp
View file @
c0bcc6fc
...
...
@@ -2,8 +2,10 @@
#define MIGRAPH_GUARD_RTGLIB_TIME_HPP
#include <chrono>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
Duration
,
class
F
>
auto
time
(
F
f
)
...
...
@@ -14,6 +16,7 @@ auto time(F f)
return
std
::
chrono
::
duration_cast
<
Duration
>
(
finish
-
start
).
count
();
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/tracer.hpp
View file @
c0bcc6fc
...
...
@@ -3,8 +3,10 @@
#include <ostream>
#include <migraph/functional.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
tracer
{
...
...
@@ -28,6 +30,7 @@ struct tracer
std
::
ostream
*
os
=
nullptr
;
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/type_name.hpp
View file @
c0bcc6fc
...
...
@@ -2,8 +2,10 @@
#define MIGRAPH_GUARD_RTGLIB_TYPE_NAME_HPP
#include <string>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
PrivateMigraphTypeNameProbe
>
const
std
::
string
&
get_type_name
()
...
...
@@ -39,6 +41,7 @@ const std::string& get_type_name(const T&)
return
migraph
::
get_type_name
<
T
>
();
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/type_traits.hpp
View file @
c0bcc6fc
...
...
@@ -10,8 +10,10 @@
#include <type_traits>
#include <migraph/half.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
#define MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(trait, T) \
template <class X> \
...
...
@@ -28,6 +30,7 @@ MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(is_floating_point, half)
MIGRAPH_DETAIL_EXTEND_TRAIT_FOR
(
is_signed
,
half
)
MIGRAPH_DETAIL_EXTEND_TRAIT_FOR
(
is_arithmetic
,
half
)
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/verify.hpp
View file @
c0bcc6fc
...
...
@@ -8,8 +8,10 @@
#include <numeric>
#include <migraph/float_equal.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
// Compute the value of a range
template
<
class
R
>
...
...
@@ -170,5 +172,7 @@ bool verify_range(R1&& r1, R2&& r2, double tolerance = 80, double* out_error = n
*
out_error
=
error
;
return
error
<=
threshold
;
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/include/migraph/verify_args.hpp
View file @
c0bcc6fc
...
...
@@ -3,8 +3,10 @@
#include <migraph/verify.hpp>
#include <migraph/argument.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
bool
verify_args
(
const
std
::
string
&
name
,
const
argument
&
cpu_arg
,
...
...
@@ -82,6 +84,7 @@ inline bool verify_args(const std::string& name,
return
passed
;
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/instruction.cpp
View file @
c0bcc6fc
...
...
@@ -3,6 +3,7 @@
#include <migraph/erase.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
instruction
::
instruction
(
operation
o
,
shape
r
,
std
::
vector
<
instruction_ref
>
args
)
:
op
(
std
::
move
(
o
)),
result
(
std
::
move
(
r
)),
arguments
(
std
::
move
(
args
))
...
...
@@ -182,4 +183,5 @@ shape compute_shape(const operation& op, const std::vector<instruction_ref>& arg
return
op
.
compute_shape
(
compute_shapes
(
args
));
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/onnx/onnx.cpp
View file @
c0bcc6fc
...
...
@@ -14,9 +14,10 @@
#include <migraph/operators.hpp>
#include <migraph/ranges.hpp>
#include <migraph/instruction.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
unknown
{
std
::
string
op
;
...
...
@@ -625,4 +626,5 @@ program parse_onnx(const std::string& name)
return
std
::
move
(
parser
.
prog
);
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/opt/common_header.hpp
View file @
c0bcc6fc
...
...
@@ -6,6 +6,7 @@
#include <migraph/operators.hpp>
#include <migraph/iterator_for.hpp>
#include <migraph/pass_config.hpp>
#include <migraph/config.hpp>
#include <set>
#include <list>
...
...
@@ -13,6 +14,7 @@
#include <queue>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
//#define MIGRAPH_DEBUG_OPT
...
...
@@ -21,6 +23,8 @@ namespace migraph {
#else
#define MIGRAPH_DEBUG(s)
#endif // MIGRAPH_DEBUG_OPT
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif // MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP
src/opt/memory_coloring.cpp
View file @
c0bcc6fc
...
...
@@ -2,6 +2,7 @@
#include "memory_coloring_impl.hpp"
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
void
memory_coloring
::
apply
(
program
&
p
)
const
{
...
...
@@ -11,4 +12,6 @@ void memory_coloring::apply(program& p) const
opt
.
run
();
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/opt/memory_coloring_impl.cpp
View file @
c0bcc6fc
#include "memory_coloring_impl.hpp"
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
void
memory_coloring_impl
::
run
()
{
...
...
@@ -357,4 +358,6 @@ void live_interval::dump()
}
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/opt/memory_coloring_impl.hpp
View file @
c0bcc6fc
#ifndef MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#define MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#include "common_header.hpp"
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
static
const
int
invalid_offset
=
-
1
;
...
...
@@ -177,5 +179,7 @@ struct memory_coloring_impl
bool
unify_literals
;
std
::
string
allocation_op
{};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
#endif
src/program.cpp
View file @
c0bcc6fc
...
...
@@ -11,6 +11,7 @@
#include <utility>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_TRACE_COMPILE
)
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_TRACE_EVAL
)
...
...
@@ -498,4 +499,6 @@ std::ostream& operator<<(std::ostream& os, const program& p)
print_program
(
os
,
p
,
[](
auto
&&
...)
{});
return
os
;
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/shape.cpp
View file @
c0bcc6fc
...
...
@@ -7,6 +7,7 @@
#include <iostream>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
shape_impl
{
...
...
@@ -190,4 +191,5 @@ std::ostream& operator<<(std::ostream& os, const shape& x)
return
os
;
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/simplify_algebra.cpp
View file @
c0bcc6fc
...
...
@@ -5,6 +5,7 @@
#include <migraph/literal.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
find_add_lit_broadcast
{
...
...
@@ -60,4 +61,5 @@ struct find_add_lit_broadcast
void
simplify_algebra
::
apply
(
program
&
p
)
const
{
match
::
find_matches
(
p
,
find_add_lit_broadcast
{});
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/simplify_reshapes.cpp
View file @
c0bcc6fc
...
...
@@ -7,6 +7,7 @@
#include <unordered_set>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
bool
is_reshaper
(
const
std
::
string
&
name
)
{
...
...
@@ -59,4 +60,5 @@ void simplify_reshapes::apply(program& p) const
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
src/targets/cpu/gemm.cpp
View file @
c0bcc6fc
...
...
@@ -4,6 +4,7 @@
#include <blaze/math/CustomMatrix.h>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
cpu
{
template
<
class
T
>
...
...
@@ -93,5 +94,5 @@ void migemm(
}
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
Prev
1
2
3
4
5
6
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