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
e1ef1e17
Commit
e1ef1e17
authored
Nov 05, 2018
by
Shucai Xiao
Browse files
Added inline namespace for all .hpp and .cpp file.
parent
1cdb49a6
Changes
134
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
63 additions
and
20 deletions
+63
-20
src/include/migraph/onnx.hpp
src/include/migraph/onnx.hpp
+3
-1
src/include/migraph/operation.hpp
src/include/migraph/operation.hpp
+3
-1
src/include/migraph/operators.hpp
src/include/migraph/operators.hpp
+3
-1
src/include/migraph/pass.hpp
src/include/migraph/pass.hpp
+3
-1
src/include/migraph/pass_config.hpp
src/include/migraph/pass_config.hpp
+4
-1
src/include/migraph/program.hpp
src/include/migraph/program.hpp
+4
-1
src/include/migraph/ranges.hpp
src/include/migraph/ranges.hpp
+3
-1
src/include/migraph/rank.hpp
src/include/migraph/rank.hpp
+4
-1
src/include/migraph/raw_data.hpp
src/include/migraph/raw_data.hpp
+3
-1
src/include/migraph/reflect.hpp
src/include/migraph/reflect.hpp
+3
-1
src/include/migraph/requires.hpp
src/include/migraph/requires.hpp
+3
-1
src/include/migraph/shape.hpp
src/include/migraph/shape.hpp
+3
-1
src/include/migraph/shape_for_each.hpp
src/include/migraph/shape_for_each.hpp
+3
-1
src/include/migraph/simplify_algebra.hpp
src/include/migraph/simplify_algebra.hpp
+3
-1
src/include/migraph/simplify_reshapes.hpp
src/include/migraph/simplify_reshapes.hpp
+3
-1
src/include/migraph/streamutils.hpp
src/include/migraph/streamutils.hpp
+3
-1
src/include/migraph/stringutils.hpp
src/include/migraph/stringutils.hpp
+3
-1
src/include/migraph/target.hpp
src/include/migraph/target.hpp
+3
-1
src/include/migraph/tensor_view.hpp
src/include/migraph/tensor_view.hpp
+3
-1
src/include/migraph/time.hpp
src/include/migraph/time.hpp
+3
-1
No files found.
src/include/migraph/onnx.hpp
View file @
e1ef1e17
...
@@ -2,12 +2,14 @@
...
@@ -2,12 +2,14 @@
#define MIGRAPH_GUARD_MIGRAPHLIB_ONNX_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_ONNX_HPP
#include <migraph/program.hpp>
#include <migraph/program.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
/// Create a program from an onnx file
/// Create a program from an onnx file
program
parse_onnx
(
const
std
::
string
&
name
);
program
parse_onnx
(
const
std
::
string
&
name
);
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/operation.hpp
View file @
e1ef1e17
...
@@ -13,8 +13,9 @@
...
@@ -13,8 +13,9 @@
#include <migraph/argument.hpp>
#include <migraph/argument.hpp>
#include <migraph/context.hpp>
#include <migraph/context.hpp>
#include <migraph/auto_any_cast.hpp>
#include <migraph/auto_any_cast.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
#ifdef DOXYGEN
#ifdef DOXYGEN
...
@@ -385,6 +386,7 @@ inline bool operator!=(const operation& x, const operation& y) { return !(x == y
...
@@ -385,6 +386,7 @@ inline bool operator!=(const operation& x, const operation& y) { return !(x == y
#endif
#endif
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/operators.hpp
View file @
e1ef1e17
...
@@ -6,10 +6,11 @@
...
@@ -6,10 +6,11 @@
#include <migraph/check_shapes.hpp>
#include <migraph/check_shapes.hpp>
#include <migraph/stringutils.hpp>
#include <migraph/stringutils.hpp>
#include <migraph/streamutils.hpp>
#include <migraph/streamutils.hpp>
#include <migraph/config.hpp>
#include <cmath>
#include <cmath>
#include <utility>
#include <utility>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
op
{
namespace
op
{
struct
not_computable
struct
not_computable
...
@@ -852,6 +853,7 @@ struct outline
...
@@ -852,6 +853,7 @@ struct outline
};
};
}
// namespace op
}
// namespace op
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/pass.hpp
View file @
e1ef1e17
...
@@ -7,8 +7,9 @@
...
@@ -7,8 +7,9 @@
#include <memory>
#include <memory>
#include <type_traits>
#include <type_traits>
#include <utility>
#include <utility>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -216,6 +217,7 @@ inline const ValueType& any_cast(const pass& x)
...
@@ -216,6 +217,7 @@ inline const ValueType& any_cast(const pass& x)
#endif
#endif
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/pass_config.hpp
View file @
e1ef1e17
...
@@ -3,9 +3,12 @@
...
@@ -3,9 +3,12 @@
#define MIGRAPH_GUARD_PASS_CONFIG_HPP
#define MIGRAPH_GUARD_PASS_CONFIG_HPP
#include <migraph/env.hpp>
#include <migraph/env.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
migraph
{
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_DISABLE_MEMORY_COLORING
)
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_DISABLE_MEMORY_COLORING
)
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif // MIGRAPH_GUARD_PASS_CONFIG_HPP
#endif // MIGRAPH_GUARD_PASS_CONFIG_HPP
src/include/migraph/program.hpp
View file @
e1ef1e17
...
@@ -9,10 +9,11 @@
...
@@ -9,10 +9,11 @@
#include <migraph/instruction_ref.hpp>
#include <migraph/instruction_ref.hpp>
#include <migraph/target.hpp>
#include <migraph/target.hpp>
#include <migraph/tracer.hpp>
#include <migraph/tracer.hpp>
#include <migraph/config.hpp>
#include <algorithm>
#include <algorithm>
#include <iostream>
#include <iostream>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program_impl
;
struct
program_impl
;
...
@@ -106,6 +107,8 @@ struct program
...
@@ -106,6 +107,8 @@ struct program
private:
private:
std
::
unique_ptr
<
program_impl
>
impl
;
std
::
unique_ptr
<
program_impl
>
impl
;
};
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/ranges.hpp
View file @
e1ef1e17
...
@@ -4,8 +4,9 @@
...
@@ -4,8 +4,9 @@
#include <algorithm>
#include <algorithm>
#include <initializer_list>
#include <initializer_list>
#include <migraph/rank.hpp>
#include <migraph/rank.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
detail
{
namespace
detail
{
...
@@ -104,6 +105,7 @@ iterator_range<Iterator> range(std::pair<Iterator, Iterator> p)
...
@@ -104,6 +105,7 @@ iterator_range<Iterator> range(std::pair<Iterator, Iterator> p)
return
{
p
.
first
,
p
.
second
};
return
{
p
.
first
,
p
.
second
};
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/rank.hpp
View file @
e1ef1e17
#ifndef MIGRAPH_GUARD_RTGLIB_RANK_HPP
#ifndef MIGRAPH_GUARD_RTGLIB_RANK_HPP
#define MIGRAPH_GUARD_RTGLIB_RANK_HPP
#define MIGRAPH_GUARD_RTGLIB_RANK_HPP
namespace
migraph
{
#include <migraph/config.hpp>
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
int
N
>
template
<
int
N
>
struct
rank
:
rank
<
N
-
1
>
struct
rank
:
rank
<
N
-
1
>
...
@@ -13,6 +15,7 @@ struct rank<0>
...
@@ -13,6 +15,7 @@ struct rank<0>
{
{
};
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/raw_data.hpp
View file @
e1ef1e17
...
@@ -4,8 +4,9 @@
...
@@ -4,8 +4,9 @@
#include <migraph/tensor_view.hpp>
#include <migraph/tensor_view.hpp>
#include <migraph/requires.hpp>
#include <migraph/requires.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
raw_data_base
struct
raw_data_base
{
{
...
@@ -203,6 +204,7 @@ auto visit_all(T&& x, Ts&&... xs)
...
@@ -203,6 +204,7 @@ auto visit_all(T&& x, Ts&&... xs)
};
};
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/reflect.hpp
View file @
e1ef1e17
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
#include <migraph/functional.hpp>
#include <migraph/functional.hpp>
#include <migraph/rank.hpp>
#include <migraph/rank.hpp>
#include <migraph/config.hpp>
#include <functional>
#include <functional>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
detail
{
namespace
detail
{
...
@@ -45,6 +46,7 @@ void reflect_each(T& x, F f)
...
@@ -45,6 +46,7 @@ void reflect_each(T& x, F f)
});
});
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/requires.hpp
View file @
e1ef1e17
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
#define MIGRAPH_GUARD_MIGRAPHLIB_REQUIRES_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_REQUIRES_HPP
#include <type_traits>
#include <type_traits>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
bool
...
Bs
>
template
<
bool
...
Bs
>
struct
and_
:
std
::
is_same
<
and_
<
Bs
...
>
,
and_
<
(
Bs
||
true
)...
>>
// NOLINT
struct
and_
:
std
::
is_same
<
and_
<
Bs
...
>
,
and_
<
(
Bs
||
true
)...
>>
// NOLINT
...
@@ -44,6 +45,7 @@ struct requires_enum
...
@@ -44,6 +45,7 @@ struct requires_enum
#endif
#endif
#endif
#endif
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/shape.hpp
View file @
e1ef1e17
...
@@ -9,8 +9,9 @@
...
@@ -9,8 +9,9 @@
#include <migraph/errors.hpp>
#include <migraph/errors.hpp>
#include <migraph/half.hpp>
#include <migraph/half.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
shape_impl
;
struct
shape_impl
;
...
@@ -161,6 +162,7 @@ struct shape
...
@@ -161,6 +162,7 @@ struct shape
std
::
string
type_string
()
const
;
std
::
string
type_string
()
const
;
};
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/shape_for_each.hpp
View file @
e1ef1e17
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
#define MIGRAPH_GUARD_MIGRAPHLIB_SHAPE_FOR_EACH_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_SHAPE_FOR_EACH_HPP
#include <migraph/shape.hpp>
#include <migraph/shape.hpp>
#include <migraph/config.hpp>
#include <algorithm>
#include <algorithm>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
F
>
template
<
class
F
>
void
shape_for_each
(
const
migraph
::
shape
&
s
,
F
f
)
void
shape_for_each
(
const
migraph
::
shape
&
s
,
F
f
)
...
@@ -26,6 +27,7 @@ void shape_for_each(const migraph::shape& s, F f)
...
@@ -26,6 +27,7 @@ void shape_for_each(const migraph::shape& s, F f)
}
}
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/simplify_algebra.hpp
View file @
e1ef1e17
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
#define MIGRAPH_GUARD_RTGLIB_SIMPLIFY_ALGEBRA_HPP
#define MIGRAPH_GUARD_RTGLIB_SIMPLIFY_ALGEBRA_HPP
#include <string>
#include <string>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -13,6 +14,7 @@ struct simplify_algebra
...
@@ -13,6 +14,7 @@ struct simplify_algebra
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/simplify_reshapes.hpp
View file @
e1ef1e17
...
@@ -3,8 +3,9 @@
...
@@ -3,8 +3,9 @@
#include <string>
#include <string>
#include <migraph/instruction_ref.hpp>
#include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -14,6 +15,7 @@ struct simplify_reshapes
...
@@ -14,6 +15,7 @@ struct simplify_reshapes
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/streamutils.hpp
View file @
e1ef1e17
...
@@ -4,8 +4,9 @@
...
@@ -4,8 +4,9 @@
#include <ostream>
#include <ostream>
#include <algorithm>
#include <algorithm>
#include <migraph/rank.hpp>
#include <migraph/rank.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
T
>
template
<
class
T
>
struct
stream_range_container
struct
stream_range_container
...
@@ -54,6 +55,7 @@ void stream_write_value(std::ostream& os, const T& x)
...
@@ -54,6 +55,7 @@ void stream_write_value(std::ostream& os, const T& x)
detail
::
stream_write_value_impl
(
rank
<
1
>
{},
os
,
x
);
detail
::
stream_write_value_impl
(
rank
<
1
>
{},
os
,
x
);
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/stringutils.hpp
View file @
e1ef1e17
...
@@ -5,8 +5,9 @@
...
@@ -5,8 +5,9 @@
#include <numeric>
#include <numeric>
#include <string>
#include <string>
#include <sstream>
#include <sstream>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
std
::
string
inline
std
::
string
replace_string
(
std
::
string
subject
,
const
std
::
string
&
search
,
const
std
::
string
&
replace
)
replace_string
(
std
::
string
subject
,
const
std
::
string
&
search
,
const
std
::
string
&
replace
)
...
@@ -85,6 +86,7 @@ inline std::string to_string(const T& x)
...
@@ -85,6 +86,7 @@ inline std::string to_string(const T& x)
return
ss
.
str
();
return
ss
.
str
();
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/target.hpp
View file @
e1ef1e17
...
@@ -10,8 +10,9 @@
...
@@ -10,8 +10,9 @@
#include <vector>
#include <vector>
#include <migraph/context.hpp>
#include <migraph/context.hpp>
#include <migraph/pass.hpp>
#include <migraph/pass.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
#ifdef DOXYGEN
#ifdef DOXYGEN
...
@@ -242,6 +243,7 @@ inline const ValueType& any_cast(const target& x)
...
@@ -242,6 +243,7 @@ inline const ValueType& any_cast(const target& x)
#endif
#endif
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/tensor_view.hpp
View file @
e1ef1e17
...
@@ -4,11 +4,12 @@
...
@@ -4,11 +4,12 @@
#include <migraph/shape.hpp>
#include <migraph/shape.hpp>
#include <migraph/float_equal.hpp>
#include <migraph/float_equal.hpp>
#include <migraph/requires.hpp>
#include <migraph/requires.hpp>
#include <migraph/config.hpp>
#include <iostream>
#include <iostream>
#include <utility>
#include <utility>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
T
>
template
<
class
T
>
struct
tensor_view
struct
tensor_view
...
@@ -167,6 +168,7 @@ tensor_view<T> make_view(shape s, T* data)
...
@@ -167,6 +168,7 @@ tensor_view<T> make_view(shape s, T* data)
return
{
s
,
data
};
return
{
s
,
data
};
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
src/include/migraph/time.hpp
View file @
e1ef1e17
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
#define MIGRAPH_GUARD_RTGLIB_TIME_HPP
#define MIGRAPH_GUARD_RTGLIB_TIME_HPP
#include <chrono>
#include <chrono>
#include <migraph/config.hpp>
namespace
migraph
{
namespace
migraph
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
Duration
,
class
F
>
template
<
class
Duration
,
class
F
>
auto
time
(
F
f
)
auto
time
(
F
f
)
...
@@ -14,6 +15,7 @@ auto time(F f)
...
@@ -14,6 +15,7 @@ auto time(F f)
return
std
::
chrono
::
duration_cast
<
Duration
>
(
finish
-
start
).
count
();
return
std
::
chrono
::
duration_cast
<
Duration
>
(
finish
-
start
).
count
();
}
}
}
// inline namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
#endif
#endif
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