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
0b217041
Commit
0b217041
authored
Nov 27, 2018
by
Paul
Browse files
Rename more things to migraphx
parent
53fd3f74
Changes
155
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
101 additions
and
101 deletions
+101
-101
src/include/migraphx/check_context.hpp
src/include/migraphx/check_context.hpp
+5
-5
src/include/migraphx/check_shapes.hpp
src/include/migraphx/check_shapes.hpp
+15
-15
src/include/migraphx/common_subexpression_elimination.hpp
src/include/migraphx/common_subexpression_elimination.hpp
+4
-4
src/include/migraphx/concat_opt.hpp
src/include/migraphx/concat_opt.hpp
+4
-4
src/include/migraphx/config.hpp
src/include/migraphx/config.hpp
+4
-4
src/include/migraphx/constant_propagate.hpp
src/include/migraphx/constant_propagate.hpp
+4
-4
src/include/migraphx/context.hpp
src/include/migraphx/context.hpp
+4
-4
src/include/migraphx/dead_code_elimination.hpp
src/include/migraphx/dead_code_elimination.hpp
+4
-4
src/include/migraphx/dfor.hpp
src/include/migraphx/dfor.hpp
+4
-4
src/include/migraphx/eliminate_allocation.hpp
src/include/migraphx/eliminate_allocation.hpp
+4
-4
src/include/migraphx/eliminate_concat.hpp
src/include/migraphx/eliminate_concat.hpp
+4
-4
src/include/migraphx/eliminate_contiguous.hpp
src/include/migraphx/eliminate_contiguous.hpp
+4
-4
src/include/migraphx/env.hpp
src/include/migraphx/env.hpp
+5
-5
src/include/migraphx/erase.hpp
src/include/migraphx/erase.hpp
+4
-4
src/include/migraphx/errors.hpp
src/include/migraphx/errors.hpp
+5
-5
src/include/migraphx/fallthrough.hpp
src/include/migraphx/fallthrough.hpp
+6
-6
src/include/migraphx/float_equal.hpp
src/include/migraphx/float_equal.hpp
+6
-6
src/include/migraphx/functional.hpp
src/include/migraphx/functional.hpp
+4
-4
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
No files found.
src/include/migraphx/check_context.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_CHECK_CONTEXT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CHECK_CONTEXT_HPP
#define MIGRAPH_GUARD_RTGLIB_CHECK_CONTEXT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CHECK_CONTEXT_HPP
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
template
<
class
T
>
template
<
class
T
>
struct
check_context
struct
check_context
...
@@ -18,7 +18,7 @@ struct check_context
...
@@ -18,7 +18,7 @@ struct check_context
{
{
T
*
x
=
any_cast
<
T
>
(
&
ctx
);
T
*
x
=
any_cast
<
T
>
(
&
ctx
);
if
(
x
==
nullptr
)
if
(
x
==
nullptr
)
MIGRAPH_THROW
(
std
::
string
(
"Unexpected context type: "
)
+
ctx
.
type_id
().
name
());
MIGRAPH
X
_THROW
(
std
::
string
(
"Unexpected context type: "
)
+
ctx
.
type_id
().
name
());
return
{};
return
{};
}
}
};
};
...
@@ -27,7 +27,7 @@ struct check_context
...
@@ -27,7 +27,7 @@ struct check_context
void
apply
(
program
&
p
)
const
{
p
.
insert_instruction
(
p
.
begin
(),
op
{});
}
void
apply
(
program
&
p
)
const
{
p
.
insert_instruction
(
p
.
begin
(),
op
{});
}
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/check_shapes.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_CHECK_SHAPES_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CHECK_SHAPES_HPP
#define MIGRAPH_GUARD_RTGLIB_CHECK_SHAPES_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CHECK_SHAPES_HPP
#include <migraphx/shape.hpp>
#include <migraphx/shape.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
#include <algorithm>
#include <algorithm>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
check_shapes
struct
check_shapes
{
{
...
@@ -46,7 +46,7 @@ struct check_shapes
...
@@ -46,7 +46,7 @@ struct check_shapes
const
check_shapes
&
has
(
std
::
size_t
n
)
const
const
check_shapes
&
has
(
std
::
size_t
n
)
const
{
{
if
(
size
()
!=
n
)
if
(
size
()
!=
n
)
MIGRAPH_THROW
(
prefix
()
+
"Wrong number of arguments: expected "
+
std
::
to_string
(
n
)
+
MIGRAPH
X
_THROW
(
prefix
()
+
"Wrong number of arguments: expected "
+
std
::
to_string
(
n
)
+
" but given "
+
std
::
to_string
(
size
()));
" but given "
+
std
::
to_string
(
size
()));
return
*
this
;
return
*
this
;
}
}
...
@@ -58,7 +58,7 @@ struct check_shapes
...
@@ -58,7 +58,7 @@ struct check_shapes
if
(
begin
!=
end
)
if
(
begin
!=
end
)
{
{
if
(
begin
->
lens
().
size
()
!=
n
)
if
(
begin
->
lens
().
size
()
!=
n
)
MIGRAPH_THROW
(
prefix
()
+
"Only "
+
std
::
to_string
(
n
)
+
"d supported"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Only "
+
std
::
to_string
(
n
)
+
"d supported"
);
}
}
return
*
this
;
return
*
this
;
}
}
...
@@ -66,56 +66,56 @@ struct check_shapes
...
@@ -66,56 +66,56 @@ struct check_shapes
const
check_shapes
&
same_shape
()
const
const
check_shapes
&
same_shape
()
const
{
{
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
;
}))
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
;
}))
MIGRAPH_THROW
(
prefix
()
+
"Shapes do not match"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Shapes do not match"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
same_type
()
const
const
check_shapes
&
same_type
()
const
{
{
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
type
();
}))
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
type
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Types do not match"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Types do not match"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
same_dims
()
const
const
check_shapes
&
same_dims
()
const
{
{
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
lens
();
}))
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
lens
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Dimensions do not match"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Dimensions do not match"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
same_ndims
()
const
const
check_shapes
&
same_ndims
()
const
{
{
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
lens
().
size
();
}))
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
lens
().
size
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Number of dimensions do not match"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Number of dimensions do not match"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
standard
()
const
const
check_shapes
&
standard
()
const
{
{
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
s
.
standard
();
}))
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
s
.
standard
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Shapes are not in standard layout"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Shapes are not in standard layout"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
packed
()
const
const
check_shapes
&
packed
()
const
{
{
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
s
.
packed
();
}))
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
s
.
packed
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Shapes are not packed"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Shapes are not packed"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
not_transposed
()
const
const
check_shapes
&
not_transposed
()
const
{
{
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
not
s
.
transposed
();
}))
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
not
s
.
transposed
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Shapes are transposed"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Shapes are transposed"
);
return
*
this
;
return
*
this
;
}
}
const
check_shapes
&
not_broadcasted
()
const
const
check_shapes
&
not_broadcasted
()
const
{
{
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
not
s
.
broadcasted
();
}))
if
(
!
this
->
all_of
([](
const
shape
&
s
)
{
return
not
s
.
broadcasted
();
}))
MIGRAPH_THROW
(
prefix
()
+
"Shapes are broadcasted"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Shapes are broadcasted"
);
return
*
this
;
return
*
this
;
}
}
...
@@ -143,7 +143,7 @@ struct check_shapes
...
@@ -143,7 +143,7 @@ struct check_shapes
const
shape
*
get
(
long
i
)
const
shape
*
get
(
long
i
)
{
{
if
(
i
>=
size
())
if
(
i
>=
size
())
MIGRAPH_THROW
(
prefix
()
+
"Accessing shape out of bounds"
);
MIGRAPH
X
_THROW
(
prefix
()
+
"Accessing shape out of bounds"
);
assert
(
begin
!=
nullptr
);
assert
(
begin
!=
nullptr
);
assert
(
end
!=
nullptr
);
assert
(
end
!=
nullptr
);
if
(
i
<
0
)
if
(
i
<
0
)
...
@@ -156,7 +156,7 @@ struct check_shapes
...
@@ -156,7 +156,7 @@ struct check_shapes
check_shapes
slice
(
long
start
,
long
last
)
{
return
{
get
(
start
),
get
(
last
),
name
};
}
check_shapes
slice
(
long
start
,
long
last
)
{
return
{
get
(
start
),
get
(
last
),
name
};
}
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/common_subexpression_elimination.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_COMMON_SUBEXPRESSION_ELIMINATION_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_COMMON_SUBEXPRESSION_ELIMINATION_HPP
#define MIGRAPH_GUARD_RTGLIB_COMMON_SUBEXPRESSION_ELIMINATION_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_COMMON_SUBEXPRESSION_ELIMINATION_HPP
#include <string>
#include <string>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -19,7 +19,7 @@ struct common_subexpression_elimination
...
@@ -19,7 +19,7 @@ struct common_subexpression_elimination
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/concat_opt.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_CONCAT_OPT_HPP
#ifndef MIGRAPH
X
_GUARD_CONCAT_OPT_HPP
#define MIGRAPH_GUARD_CONCAT_OPT_HPP
#define MIGRAPH
X
_GUARD_CONCAT_OPT_HPP
#include <cassert>
#include <cassert>
#include <string>
#include <string>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -235,7 +235,7 @@ inline const ValueType& any_cast(const concat_optimization& x)
...
@@ -235,7 +235,7 @@ inline const ValueType& any_cast(const concat_optimization& x)
}
}
#endif
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/config.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_CONFIG_HPP
#ifndef MIGRAPH
X
_GUARD_CONFIG_HPP
#define MIGRAPH_GUARD_CONFIG_HPP
#define MIGRAPH
X
_GUARD_CONFIG_HPP
namespace
migraphx
{
namespace
migraphx
{
#if !defined(MIGRAPH_USE_CLANG_TIDY) && !defined(DOXYGEN)
#if !defined(MIGRAPH
X
_USE_CLANG_TIDY) && !defined(DOXYGEN)
#define MIGRAPH_INLINE_NS version_1
#define MIGRAPH
X
_INLINE_NS version_1
#endif
#endif
}
// namespace migraphx
}
// namespace migraphx
...
...
src/include/migraphx/constant_propagate.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_CONSTANT_PROPAGATE_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONSTANT_PROPAGATE_HPP
#define MIGRAPH_GUARD_RTGLIB_CONSTANT_PROPAGATE_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONSTANT_PROPAGATE_HPP
#include <string>
#include <string>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -18,7 +18,7 @@ struct constant_propagate
...
@@ -18,7 +18,7 @@ struct constant_propagate
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/context.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_CONTEXT_HPP
#ifndef MIGRAPH
X
_GUARD_CONTEXT_HPP
#define MIGRAPH_GUARD_CONTEXT_HPP
#define MIGRAPH
X
_GUARD_CONTEXT_HPP
#include <cassert>
#include <cassert>
#include <string>
#include <string>
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
#ifdef DOXYGEN
#ifdef DOXYGEN
...
@@ -205,7 +205,7 @@ inline const ValueType& any_cast(const context& x)
...
@@ -205,7 +205,7 @@ inline const ValueType& any_cast(const context& x)
#endif
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/dead_code_elimination.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_DEAD_CODE_ELIMINATION_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_DEAD_CODE_ELIMINATION_HPP
#define MIGRAPH_GUARD_RTGLIB_DEAD_CODE_ELIMINATION_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_DEAD_CODE_ELIMINATION_HPP
#include <string>
#include <string>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -19,7 +19,7 @@ struct dead_code_elimination
...
@@ -19,7 +19,7 @@ struct dead_code_elimination
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/dfor.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_DFOR_HPP
#ifndef MIGRAPH
X
_GUARD_MIGRAPHLIB_DFOR_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_DFOR_HPP
#define MIGRAPH
X
_GUARD_MIGRAPHLIB_DFOR_HPP
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
// Multidimensional for loop
// Multidimensional for loop
inline
auto
dfor
()
inline
auto
dfor
()
...
@@ -23,7 +23,7 @@ auto dfor(T x, Ts... xs)
...
@@ -23,7 +23,7 @@ auto dfor(T x, Ts... xs)
};
};
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/eliminate_allocation.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_ELIMINATE_ALLOCATION_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ELIMINATE_ALLOCATION_HPP
#define MIGRAPH_GUARD_RTGLIB_ELIMINATE_ALLOCATION_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ELIMINATE_ALLOCATION_HPP
#include <string>
#include <string>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -22,7 +22,7 @@ struct eliminate_allocation
...
@@ -22,7 +22,7 @@ struct eliminate_allocation
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/eliminate_concat.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_ELIMINATE_CONCAT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ELIMINATE_CONCAT_HPP
#define MIGRAPH_GUARD_RTGLIB_ELIMINATE_CONCAT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ELIMINATE_CONCAT_HPP
#include <string>
#include <string>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/instruction_ref.hpp>
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -21,7 +21,7 @@ struct eliminate_concat
...
@@ -21,7 +21,7 @@ struct eliminate_concat
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/eliminate_contiguous.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_ELIMINATE_CONTIGUOUS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ELIMINATE_CONTIGUOUS_HPP
#define MIGRAPH_GUARD_RTGLIB_ELIMINATE_CONTIGUOUS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ELIMINATE_CONTIGUOUS_HPP
#include <string>
#include <string>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -19,7 +19,7 @@ struct eliminate_contiguous
...
@@ -19,7 +19,7 @@ struct eliminate_contiguous
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/env.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_ENV_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ENV_HPP
#define MIGRAPH_GUARD_RTGLIB_ENV_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ENV_HPP
#include <vector>
#include <vector>
#include <string>
#include <string>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
// Declare a cached environment variable
// Declare a cached environment variable
#define MIGRAPH_DECLARE_ENV_VAR(x) \
#define MIGRAPH
X
_DECLARE_ENV_VAR(x) \
struct x \
struct x \
{ \
{ \
static const char* value() { return #x; } \
static const char* value() { return #x; } \
...
@@ -33,7 +33,7 @@ bool disabled(T)
...
@@ -33,7 +33,7 @@ bool disabled(T)
return
result
;
return
result
;
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/erase.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_ERASE_HPP
#ifndef MIGRAPH
X
_GUARD_ERASE_HPP
#define MIGRAPH_GUARD_ERASE_HPP
#define MIGRAPH
X
_GUARD_ERASE_HPP
#include <algorithm>
#include <algorithm>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
/**
/**
* @brief Erase all elements from a container
* @brief Erase all elements from a container
...
@@ -33,7 +33,7 @@ auto erase_if(R&& r, P&& pred)
...
@@ -33,7 +33,7 @@ auto erase_if(R&& r, P&& pred)
return
r
.
erase
(
std
::
remove_if
(
r
.
begin
(),
r
.
end
(),
pred
),
r
.
end
());
return
r
.
erase
(
std
::
remove_if
(
r
.
begin
(),
r
.
end
(),
pred
),
r
.
end
());
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/errors.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_ERRORS_HPP
#ifndef MIGRAPH
X
_GUARD_ERRORS_HPP
#define MIGRAPH_GUARD_ERRORS_HPP
#define MIGRAPH
X
_GUARD_ERRORS_HPP
#include <exception>
#include <exception>
#include <stdexcept>
#include <stdexcept>
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
/// Represents exceptions that can be thrown by migraphxlib
/// Represents exceptions that can be thrown by migraphxlib
struct
exception
:
std
::
runtime_error
struct
exception
:
std
::
runtime_error
...
@@ -43,10 +43,10 @@ inline std::string make_source_context(const std::string& file, int line)
...
@@ -43,10 +43,10 @@ inline std::string make_source_context(const std::string& file, int line)
/**
/**
* @brief Throw an exception with context information
* @brief Throw an exception with context information
*/
*/
#define MIGRAPH_THROW(...) \
#define MIGRAPH
X
_THROW(...) \
throw migraphx::make_exception(migraphx::make_source_context(__FILE__, __LINE__), __VA_ARGS__)
throw migraphx::make_exception(migraphx::make_source_context(__FILE__, __LINE__), __VA_ARGS__)
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/fallthrough.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_FALLTHROUGH_HPP
#ifndef MIGRAPH
X
_GUARD_FALLTHROUGH_HPP
#define MIGRAPH_GUARD_FALLTHROUGH_HPP
#define MIGRAPH
X
_GUARD_FALLTHROUGH_HPP
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
#ifdef __clang__
#ifdef __clang__
#define MIGRAPH_FALLTHROUGH [[clang::fallthrough]]
#define MIGRAPH
X
_FALLTHROUGH [[clang::fallthrough]]
#else
#else
#define MIGRAPH_FALLTHROUGH
#define MIGRAPH
X
_FALLTHROUGH
#endif
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/float_equal.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_FLOAT_EQUAL_HPP
#ifndef MIGRAPH
X
_GUARD_MIGRAPHLIB_FLOAT_EQUAL_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_FLOAT_EQUAL_HPP
#define MIGRAPH
X
_GUARD_MIGRAPHLIB_FLOAT_EQUAL_HPP
#include <algorithm>
#include <algorithm>
#include <cmath>
#include <cmath>
...
@@ -12,14 +12,14 @@
...
@@ -12,14 +12,14 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
template
<
class
...
Ts
>
template
<
class
...
Ts
>
using
common_type
=
typename
std
::
common_type
<
Ts
...
>::
type
;
using
common_type
=
typename
std
::
common_type
<
Ts
...
>::
type
;
struct
float_equal_fn
struct
float_equal_fn
{
{
template
<
class
T
,
MIGRAPH_REQUIRES
(
std
::
is_floating_point
<
T
>{})
>
template
<
class
T
,
MIGRAPH
X
_REQUIRES
(
std
::
is_floating_point
<
T
>{})
>
static
bool
apply
(
T
x
,
T
y
)
static
bool
apply
(
T
x
,
T
y
)
{
{
return
std
::
isfinite
(
x
)
and
std
::
isfinite
(
y
)
and
return
std
::
isfinite
(
x
)
and
std
::
isfinite
(
y
)
and
...
@@ -27,7 +27,7 @@ struct float_equal_fn
...
@@ -27,7 +27,7 @@ struct float_equal_fn
std
::
nextafter
(
x
,
std
::
numeric_limits
<
T
>::
max
())
>=
y
;
std
::
nextafter
(
x
,
std
::
numeric_limits
<
T
>::
max
())
>=
y
;
}
}
template
<
class
T
,
MIGRAPH_REQUIRES
(
not
std
::
is_floating_point
<
T
>{})
>
template
<
class
T
,
MIGRAPH
X
_REQUIRES
(
not
std
::
is_floating_point
<
T
>{})
>
static
bool
apply
(
T
x
,
T
y
)
static
bool
apply
(
T
x
,
T
y
)
{
{
return
x
==
y
;
return
x
==
y
;
...
@@ -42,7 +42,7 @@ struct float_equal_fn
...
@@ -42,7 +42,7 @@ struct float_equal_fn
static
constexpr
float_equal_fn
float_equal
{};
static
constexpr
float_equal_fn
float_equal
{};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/functional.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_FUNCTIONAL_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_FUNCTIONAL_HPP
#define MIGRAPH_GUARD_RTGLIB_FUNCTIONAL_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_FUNCTIONAL_HPP
#include <utility>
#include <utility>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
swallow
struct
swallow
{
{
...
@@ -131,7 +131,7 @@ auto fold(F f)
...
@@ -131,7 +131,7 @@ auto fold(F f)
return
[
=
](
auto
&&
...
xs
)
{
return
fold_impl
(
f
,
std
::
forward
<
decltype
(
xs
)
>
(
xs
)...);
};
return
[
=
](
auto
&&
...
xs
)
{
return
fold_impl
(
f
,
std
::
forward
<
decltype
(
xs
)
>
(
xs
)...);
};
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/fwd_conv_batchnorm_rewrite.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_RTGLIB_FWD_CONV_BATCHNORM_REWRITE_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_FWD_CONV_BATCHNORM_REWRITE_HPP
#define MIGRAPH_GUARD_RTGLIB_FWD_CONV_BATCHNORM_REWRITE_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_FWD_CONV_BATCHNORM_REWRITE_HPP
#include <string>
#include <string>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
program
;
struct
program
;
...
@@ -19,7 +19,7 @@ struct fwd_conv_batchnorm_rewrite
...
@@ -19,7 +19,7 @@ struct fwd_conv_batchnorm_rewrite
void
apply
(
program
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/generate.hpp
View file @
0b217041
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_GENERATE_HPP
#ifndef MIGRAPH
X
_GUARD_MIGRAPHLIB_GENERATE_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_GENERATE_HPP
#define MIGRAPH
X
_GUARD_MIGRAPHLIB_GENERATE_HPP
#include <migraphx/argument.hpp>
#include <migraphx/argument.hpp>
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
#include <random>
#include <random>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
template
<
class
T
,
MIGRAPH_REQUIRES
(
is_floating_point
<
T
>{})
>
template
<
class
T
,
MIGRAPH
X
_REQUIRES
(
is_floating_point
<
T
>{})
>
constexpr
T
normalize
(
unsigned
long
z
)
constexpr
T
normalize
(
unsigned
long
z
)
{
{
if
(
z
==
0
)
if
(
z
==
0
)
...
@@ -22,7 +22,7 @@ constexpr T normalize(unsigned long z)
...
@@ -22,7 +22,7 @@ constexpr T normalize(unsigned long z)
return
T
(
result
);
return
T
(
result
);
}
}
template
<
class
T
,
MIGRAPH_REQUIRES
(
is_signed
<
T
>{}
and
not
is_floating_point
<
T
>
{})
>
template
<
class
T
,
MIGRAPH
X
_REQUIRES
(
is_signed
<
T
>{}
and
not
is_floating_point
<
T
>
{})
>
constexpr
T
normalize
(
unsigned
long
z
)
constexpr
T
normalize
(
unsigned
long
z
)
{
{
const
auto
max
=
std
::
numeric_limits
<
T
>::
max
();
const
auto
max
=
std
::
numeric_limits
<
T
>::
max
();
...
@@ -30,7 +30,7 @@ constexpr T normalize(unsigned long z)
...
@@ -30,7 +30,7 @@ constexpr T normalize(unsigned long z)
return
half_max
-
(
z
%
max
);
return
half_max
-
(
z
%
max
);
}
}
template
<
class
T
,
MIGRAPH_REQUIRES
(
not
is_signed
<
T
>{}
and
std
::
is_integral
<
T
>
{})
>
template
<
class
T
,
MIGRAPH
X
_REQUIRES
(
not
is_signed
<
T
>{}
and
std
::
is_integral
<
T
>
{})
>
constexpr
T
normalize
(
unsigned
long
z
)
constexpr
T
normalize
(
unsigned
long
z
)
{
{
const
auto
max
=
std
::
numeric_limits
<
T
>::
max
();
const
auto
max
=
std
::
numeric_limits
<
T
>::
max
();
...
@@ -93,7 +93,7 @@ literal generate_literal(shape s, unsigned long seed = 0);
...
@@ -93,7 +93,7 @@ literal generate_literal(shape s, unsigned long seed = 0);
literal
abs
(
literal
l
);
literal
abs
(
literal
l
);
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
Prev
1
2
3
4
5
6
…
8
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