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
65c5581f
Unverified
Commit
65c5581f
authored
Nov 14, 2018
by
Paul Fultz II
Committed by
GitHub
Nov 14, 2018
Browse files
Merge branch 'master' into identity
parents
453fa37a
f04a3ba6
Changes
192
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
117 additions
and
117 deletions
+117
-117
src/include/migraphx/erase.hpp
src/include/migraphx/erase.hpp
+3
-3
src/include/migraphx/errors.hpp
src/include/migraphx/errors.hpp
+5
-5
src/include/migraphx/fallthrough.hpp
src/include/migraphx/fallthrough.hpp
+3
-3
src/include/migraphx/float_equal.hpp
src/include/migraphx/float_equal.hpp
+4
-4
src/include/migraphx/functional.hpp
src/include/migraphx/functional.hpp
+3
-3
src/include/migraphx/fwd_conv_batchnorm_rewrite.hpp
src/include/migraphx/fwd_conv_batchnorm_rewrite.hpp
+4
-4
src/include/migraphx/generate.hpp
src/include/migraphx/generate.hpp
+7
-7
src/include/migraphx/half.hpp
src/include/migraphx/half.hpp
+3
-3
src/include/migraphx/instruction.hpp
src/include/migraphx/instruction.hpp
+12
-12
src/include/migraphx/instruction_ref.hpp
src/include/migraphx/instruction_ref.hpp
+3
-3
src/include/migraphx/iterator_for.hpp
src/include/migraphx/iterator_for.hpp
+3
-3
src/include/migraphx/literal.hpp
src/include/migraphx/literal.hpp
+9
-9
src/include/migraphx/make_shared_array.hpp
src/include/migraphx/make_shared_array.hpp
+3
-3
src/include/migraphx/manage_ptr.hpp
src/include/migraphx/manage_ptr.hpp
+4
-4
src/include/migraphx/matcher.hpp
src/include/migraphx/matcher.hpp
+21
-21
src/include/migraphx/memory_coloring.hpp
src/include/migraphx/memory_coloring.hpp
+4
-4
src/include/migraphx/onnx.hpp
src/include/migraphx/onnx.hpp
+4
-4
src/include/migraphx/operation.hpp
src/include/migraphx/operation.hpp
+12
-12
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+7
-7
src/include/migraphx/pass.hpp
src/include/migraphx/pass.hpp
+3
-3
No files found.
src/include/migraph/erase.hpp
→
src/include/migraph
x
/erase.hpp
View file @
65c5581f
...
...
@@ -2,9 +2,9 @@
#define MIGRAPH_GUARD_ERASE_HPP
#include <algorithm>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
/**
...
...
@@ -34,6 +34,6 @@ auto erase_if(R&& r, P&& pred)
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/errors.hpp
→
src/include/migraph
x
/errors.hpp
View file @
65c5581f
...
...
@@ -4,12 +4,12 @@
#include <exception>
#include <stdexcept>
#include <string>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
/// Represents exceptions that can be thrown by migraphlib
/// Represents exceptions that can be thrown by migraph
x
lib
struct
exception
:
std
::
runtime_error
{
exception
(
const
std
::
string
&
msg
=
""
)
:
std
::
runtime_error
(
msg
)
{}
...
...
@@ -44,9 +44,9 @@ inline std::string make_source_context(const std::string& file, int line)
* @brief Throw an exception with context information
*/
#define MIGRAPH_THROW(...) \
throw migraph::make_exception(migraph::make_source_context(__FILE__, __LINE__), __VA_ARGS__)
throw migraph
x
::make_exception(migraph
x
::make_source_context(__FILE__, __LINE__), __VA_ARGS__)
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/fallthrough.hpp
→
src/include/migraph
x
/fallthrough.hpp
View file @
65c5581f
#ifndef MIGRAPH_GUARD_FALLTHROUGH_HPP
#define MIGRAPH_GUARD_FALLTHROUGH_HPP
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
#ifdef __clang__
...
...
@@ -13,6 +13,6 @@ inline namespace MIGRAPH_INLINE_NS {
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/float_equal.hpp
→
src/include/migraph
x
/float_equal.hpp
View file @
65c5581f
...
...
@@ -8,10 +8,10 @@
#include <iso646.h>
#endif
#include <migraph/requires.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/requires.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
...
Ts
>
...
...
@@ -43,6 +43,6 @@ struct float_equal_fn
static
constexpr
float_equal_fn
float_equal
{};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/functional.hpp
→
src/include/migraph
x
/functional.hpp
View file @
65c5581f
...
...
@@ -2,9 +2,9 @@
#define MIGRAPH_GUARD_RTGLIB_FUNCTIONAL_HPP
#include <utility>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
swallow
...
...
@@ -132,6 +132,6 @@ auto fold(F f)
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/fwd_conv_batchnorm_rewrite.hpp
→
src/include/migraph
x
/fwd_conv_batchnorm_rewrite.hpp
View file @
65c5581f
...
...
@@ -2,10 +2,10 @@
#define MIGRAPH_GUARD_RTGLIB_FWD_CONV_BATCHNORM_REWRITE_HPP
#include <string>
#include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/instruction_ref.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -20,6 +20,6 @@ struct fwd_conv_batchnorm_rewrite
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/generate.hpp
→
src/include/migraph
x
/generate.hpp
View file @
65c5581f
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_GENERATE_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_GENERATE_HPP
#include <migraph/argument.hpp>
#include <migraph/literal.hpp>
#include <migraph/type_traits.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/argument.hpp>
#include <migraph
x
/literal.hpp>
#include <migraph
x
/type_traits.hpp>
#include <migraph
x
/config.hpp>
#include <random>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
T
,
MIGRAPH_REQUIRES
(
is_floating_point
<
T
>{})
>
...
...
@@ -78,7 +78,7 @@ struct xorshift_generator
};
template
<
class
T
>
std
::
vector
<
T
>
generate_tensor_data
(
const
migraph
::
shape
&
s
,
unsigned
long
seed
=
0
)
std
::
vector
<
T
>
generate_tensor_data
(
const
migraph
x
::
shape
&
s
,
unsigned
long
seed
=
0
)
{
std
::
vector
<
T
>
result
(
s
.
elements
());
std
::
generate
(
result
.
begin
(),
result
.
end
(),
xorshf96_generator
<
T
>
{
seed
});
...
...
@@ -94,6 +94,6 @@ literal generate_literal(shape s, unsigned long seed = 0);
literal
abs
(
literal
l
);
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/half.hpp
→
src/include/migraph
x
/half.hpp
View file @
65c5581f
...
...
@@ -9,9 +9,9 @@
#define MIGRAPH_GUARD_RTGLIB_HALF_HPP
#include <half.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
using
half
=
half_float
::
half
;
...
...
@@ -34,6 +34,6 @@ template <class T>
using
deduce
=
typename
detail
::
deduce
<
T
>::
type
;
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/instruction.hpp
→
src/include/migraph
x
/instruction.hpp
View file @
65c5581f
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_INSTRUCTION_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_INSTRUCTION_HPP
#include <migraph/literal.hpp>
#include <migraph/shape.hpp>
#include <migraph/instruction_ref.hpp>
#include <migraph/operation.hpp>
#include <migraph/erase.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/literal.hpp>
#include <migraph
x
/shape.hpp>
#include <migraph
x
/instruction_ref.hpp>
#include <migraph
x
/operation.hpp>
#include <migraph
x
/erase.hpp>
#include <migraph
x
/config.hpp>
#include <string>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
shape
compute_shape
(
const
operation
&
op
,
const
std
::
vector
<
instruction_ref
>&
args
);
...
...
@@ -61,7 +61,7 @@ struct instruction
template
<
class
T
>
void
remove_output
(
const
T
&
ins
)
{
migraph
::
erase
(
output
,
ins
);
migraph
x
::
erase
(
output
,
ins
);
}
static
void
backreference
(
instruction_ref
ref
);
...
...
@@ -91,17 +91,17 @@ struct instruction
literal
lit
;
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
namespace
std
{
template
<
>
struct
hash
<
migraph
::
instruction_ref
>
struct
hash
<
migraph
x
::
instruction_ref
>
{
using
argument_type
=
migraph
::
instruction_ref
;
using
argument_type
=
migraph
x
::
instruction_ref
;
using
result_type
=
std
::
size_t
;
result_type
operator
()(
const
argument_type
&
x
)
const
noexcept
{
return
std
::
hash
<
migraph
::
instruction
*>
{}(
&*
x
);
return
std
::
hash
<
migraph
x
::
instruction
*>
{}(
&*
x
);
}
};
...
...
src/include/migraph/instruction_ref.hpp
→
src/include/migraph
x
/instruction_ref.hpp
View file @
65c5581f
...
...
@@ -3,15 +3,15 @@
#include <list>
#include <functional>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
instruction
;
using
instruction_ref
=
std
::
list
<
instruction
>::
iterator
;
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/iterator_for.hpp
→
src/include/migraph
x
/iterator_for.hpp
View file @
65c5581f
...
...
@@ -3,9 +3,9 @@
#include <cassert>
#include <type_traits>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
T
>
...
...
@@ -40,6 +40,6 @@ iterator_for_range<T> iterator_for(T& x)
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/literal.hpp
→
src/include/migraph
x
/literal.hpp
View file @
65c5581f
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_LITERAL_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_LITERAL_HPP
#include <migraph/shape.hpp>
#include <migraph/shape_for_each.hpp>
#include <migraph/argument.hpp>
#include <migraph/tensor_view.hpp>
#include <migraph/raw_data.hpp>
#include <migraph/make_shared_array.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/shape.hpp>
#include <migraph
x
/shape_for_each.hpp>
#include <migraph
x
/argument.hpp>
#include <migraph
x
/tensor_view.hpp>
#include <migraph
x
/raw_data.hpp>
#include <migraph
x
/make_shared_array.hpp>
#include <migraph
x
/config.hpp>
#include <memory>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
/**
...
...
@@ -125,6 +125,6 @@ literal transform(literal l1, literal l2, F f)
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/make_shared_array.hpp
→
src/include/migraph
x
/make_shared_array.hpp
View file @
65c5581f
...
...
@@ -2,9 +2,9 @@
#define MIGRAPH_GUARD_MIGRAPHLIB_MAKE_SHARED_ARRAY_HPP
#include <memory>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
typename
T
>
...
...
@@ -14,6 +14,6 @@ std::shared_ptr<T> make_shared_array(size_t size)
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/manage_ptr.hpp
→
src/include/migraph
x
/manage_ptr.hpp
View file @
65c5581f
...
...
@@ -3,9 +3,9 @@
#include <memory>
#include <type_traits>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
template
<
class
F
,
F
f
>
// NOLINT
...
...
@@ -52,9 +52,9 @@ shared<T> share(T p)
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#define MIGRAPH_MANAGE_PTR(T, F) \
migraph::manage_ptr<std::remove_pointer_t<T>, decltype(&F), &F> // NOLINT
migraph
x
::manage_ptr<std::remove_pointer_t<T>, decltype(&F), &F> // NOLINT
#endif
src/include/migraph/matcher.hpp
→
src/include/migraph
x
/matcher.hpp
View file @
65c5581f
#ifndef MIGRAPH_GUARD_RTGLIB_MATCHER_HPP
#define MIGRAPH_GUARD_RTGLIB_MATCHER_HPP
#include <migraph/functional.hpp>
#include <migraph/ranges.hpp>
#include <migraph/instruction.hpp>
#include <migraph/program.hpp>
#include <migraph/iterator_for.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/functional.hpp>
#include <migraph
x
/ranges.hpp>
#include <migraph
x
/instruction.hpp>
#include <migraph
x
/program.hpp>
#include <migraph
x
/iterator_for.hpp>
#include <migraph
x
/config.hpp>
#include <unordered_map>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
match
{
...
...
@@ -169,22 +169,22 @@ basic_matcher<predicate_matcher<P>> make_basic_pred_matcher(P p)
}
/// This macro takes care of the boilerplate for defining a matcher
#define MIGRAPH_BASIC_MATCHER(name, ...) \
struct name##_m \
{ \
instruction_ref match(__VA_ARGS__) const; \
}; \
const constexpr auto name = migraph::match::basic_matcher<name##_m>{{}}; \
#define MIGRAPH_BASIC_MATCHER(name, ...)
\
struct name##_m
\
{
\
instruction_ref match(__VA_ARGS__) const;
\
};
\
const constexpr auto name = migraph
x
::match::basic_matcher<name##_m>{{}}; \
inline instruction_ref name##_m::match(__VA_ARGS__) const
/// This macro takes care of the boilerplate for defining a predicate matcher
#define MIGRAPH_PRED_MATCHER(name, ...) \
struct name##_m \
{ \
bool operator()(__VA_ARGS__) const; \
}; \
const constexpr auto name = \
migraph::match::basic_matcher<migraph::match::predicate_matcher<name##_m>>{{}}; \
#define MIGRAPH_PRED_MATCHER(name, ...)
\
struct name##_m
\
{
\
bool operator()(__VA_ARGS__) const;
\
};
\
const constexpr auto name =
\
migraph
x
::match::basic_matcher<migraph
x
::match::predicate_matcher<name##_m>>{{}}; \
inline bool name##_m::operator()(__VA_ARGS__) const
struct
matcher_result
...
...
@@ -341,6 +341,6 @@ inline auto either_arg(std::size_t i, std::size_t j)
}
// namespace match
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/memory_coloring.hpp
→
src/include/migraph
x
/memory_coloring.hpp
View file @
65c5581f
...
...
@@ -2,10 +2,10 @@
#define MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_HPP
#include <string>
#include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/instruction_ref.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -21,6 +21,6 @@ struct memory_coloring
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/onnx.hpp
→
src/include/migraph
x
/onnx.hpp
View file @
65c5581f
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_ONNX_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_ONNX_HPP
#include <migraph/program.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/program.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
/// Create a program from an onnx file
program
parse_onnx
(
const
std
::
string
&
name
);
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/operation.hpp
→
src/include/migraph
x
/operation.hpp
View file @
65c5581f
...
...
@@ -7,15 +7,15 @@
#include <memory>
#include <type_traits>
#include <utility>
#include <migraph/shape.hpp>
#include <migraph/reflect.hpp>
#include <migraph/streamutils.hpp>
#include <migraph/argument.hpp>
#include <migraph/context.hpp>
#include <migraph/auto_any_cast.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
#include <migraph
x
/shape.hpp>
#include <migraph
x
/reflect.hpp>
#include <migraph
x
/streamutils.hpp>
#include <migraph
x
/argument.hpp>
#include <migraph
x
/context.hpp>
#include <migraph
x
/auto_any_cast.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
#ifdef DOXYGEN
...
...
@@ -308,13 +308,13 @@ struct operation
std
::
ostream
&
operator_shift_left
(
std
::
ostream
&
os
)
const
override
{
using
migraph
::
operation_stream
::
operator
<<
;
using
migraph
x
::
operation_stream
::
operator
<<
;
return
os
<<
private_detail_te_value
;
}
bool
operator
==
(
const
operation
&
y
)
const
override
{
using
migraph
::
operation_equal
::
operator
==
;
using
migraph
x
::
operation_equal
::
operator
==
;
return
private_detail_te_value
==
y
;
}
...
...
@@ -388,6 +388,6 @@ inline bool operator!=(const operation& x, const operation& y) { return !(x == y
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/operators.hpp
→
src/include/migraph
x
/operators.hpp
View file @
65c5581f
...
...
@@ -2,15 +2,15 @@
#define MIGRAPH_GUARD_OPERATORS_HPP
#include <array>
#include <migraph/operation.hpp>
#include <migraph/check_shapes.hpp>
#include <migraph/stringutils.hpp>
#include <migraph/streamutils.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/operation.hpp>
#include <migraph
x
/check_shapes.hpp>
#include <migraph
x
/stringutils.hpp>
#include <migraph
x
/streamutils.hpp>
#include <migraph
x
/config.hpp>
#include <cmath>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
op
{
...
...
@@ -905,6 +905,6 @@ struct outline
}
// namespace op
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/include/migraph/pass.hpp
→
src/include/migraph
x
/pass.hpp
View file @
65c5581f
...
...
@@ -7,9 +7,9 @@
#include <memory>
#include <type_traits>
#include <utility>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
struct
program
;
...
...
@@ -219,6 +219,6 @@ inline const ValueType& any_cast(const pass& x)
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
Prev
1
2
3
4
5
6
7
…
10
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