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
a5c1c7f6
"...research_projects/controlnetxs/pipeline_controlnet_xs.py" did not exist on "7ce3fa010a5019ed35d5a89572d3f68646b2a8d9"
Unverified
Commit
a5c1c7f6
authored
Feb 10, 2019
by
Paul Fultz II
Committed by
GitHub
Feb 10, 2019
Browse files
Merge branch 'develop' into mem_color_ordering_fix
parents
462a4920
d516b099
Changes
303
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
122 additions
and
96 deletions
+122
-96
src/env.cpp
src/env.cpp
+2
-2
src/fwd_conv_batchnorm_rewrite.cpp
src/fwd_conv_batchnorm_rewrite.cpp
+2
-2
src/generate.cpp
src/generate.cpp
+2
-2
src/include/migraphx/argument.hpp
src/include/migraphx/argument.hpp
+4
-4
src/include/migraphx/auto_any_cast.hpp
src/include/migraphx/auto_any_cast.hpp
+8
-4
src/include/migraphx/auto_contiguous.hpp
src/include/migraphx/auto_contiguous.hpp
+4
-4
src/include/migraphx/builtin.hpp
src/include/migraphx/builtin.hpp
+9
-9
src/include/migraphx/check_context.hpp
src/include/migraphx/check_context.hpp
+14
-6
src/include/migraphx/check_shapes.hpp
src/include/migraphx/check_shapes.hpp
+16
-16
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
+12
-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
+12
-6
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
No files found.
src/env.cpp
View file @
a5c1c7f6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include <cstdlib>
#include <cstdlib>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
bool
enabled
(
const
char
*
name
)
bool
enabled
(
const
char
*
name
)
{
{
...
@@ -30,5 +30,5 @@ std::vector<std::string> env(const char* name)
...
@@ -30,5 +30,5 @@ std::vector<std::string> env(const char* name)
return
{{
p
}};
return
{{
p
}};
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/fwd_conv_batchnorm_rewrite.cpp
View file @
a5c1c7f6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <migraphx/dfor.hpp>
#include <migraphx/dfor.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
void
fwd_conv_batchnorm_rewrite
::
apply
(
program
&
p
)
const
void
fwd_conv_batchnorm_rewrite
::
apply
(
program
&
p
)
const
{
{
...
@@ -67,5 +67,5 @@ void fwd_conv_batchnorm_rewrite::apply(program& p) const
...
@@ -67,5 +67,5 @@ void fwd_conv_batchnorm_rewrite::apply(program& p) const
}
}
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/generate.cpp
View file @
a5c1c7f6
#include <migraphx/generate.hpp>
#include <migraphx/generate.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
argument
generate_argument
(
shape
s
,
unsigned
long
seed
)
argument
generate_argument
(
shape
s
,
unsigned
long
seed
)
{
{
...
@@ -31,5 +31,5 @@ literal abs(literal l)
...
@@ -31,5 +31,5 @@ literal abs(literal l)
return
transform
(
std
::
move
(
l
),
[](
auto
x
)
{
return
std
::
fabs
(
x
);
});
return
transform
(
std
::
move
(
l
),
[](
auto
x
)
{
return
std
::
fabs
(
x
);
});
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/include/migraphx/argument.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_ARGUMENT_HPP
#ifndef MIGRAPH
X
_GUARD_MIGRAPHLIB_ARGUMENT_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_ARGUMENT_HPP
#define MIGRAPH
X
_GUARD_MIGRAPHLIB_ARGUMENT_HPP
#include <migraphx/shape.hpp>
#include <migraphx/shape.hpp>
#include <migraphx/raw_data.hpp>
#include <migraphx/raw_data.hpp>
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
/**
/**
* @brief Arguments passed to instructions
* @brief Arguments passed to instructions
...
@@ -47,7 +47,7 @@ struct argument : raw_data<argument>
...
@@ -47,7 +47,7 @@ struct argument : raw_data<argument>
shape
m_shape
;
shape
m_shape
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/auto_any_cast.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_AUTO_ANY_CAST_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_AUTO_ANY_CAST_HPP
#define MIGRAPH_GUARD_RTGLIB_AUTO_ANY_CAST_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_AUTO_ANY_CAST_HPP
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
// Forward declare any_cast
template
<
class
T
>
const
T
&
any_cast
(
const
T
&
);
namespace
detail
{
namespace
detail
{
...
@@ -34,7 +38,7 @@ detail::auto_any_caster<T> auto_any_cast(T& x)
...
@@ -34,7 +38,7 @@ detail::auto_any_caster<T> auto_any_cast(T& x)
return
{
x
};
return
{
x
};
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/auto_contiguous.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_AUTO_CONTIGOUS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_AUTO_CONTIGOUS_HPP
#define MIGRAPH_GUARD_RTGLIB_AUTO_CONTIGOUS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_AUTO_CONTIGOUS_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
;
...
@@ -16,7 +16,7 @@ struct auto_contiguous
...
@@ -16,7 +16,7 @@ struct auto_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/builtin.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_BUILTIN_HPP
#ifndef MIGRAPH
X
_GUARD_BUILTIN_HPP
#define MIGRAPH_GUARD_BUILTIN_HPP
#define MIGRAPH
X
_GUARD_BUILTIN_HPP
#include <migraphx/context.hpp>
#include <migraphx/context.hpp>
#include <migraphx/errors.hpp>
#include <migraphx/errors.hpp>
...
@@ -8,17 +8,17 @@
...
@@ -8,17 +8,17 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
builtin
{
namespace
builtin
{
struct
literal
struct
literal
{
{
std
::
string
name
()
const
{
return
"@literal"
;
}
std
::
string
name
()
const
{
return
"@literal"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
MIGRAPH_THROW
(
"builtin"
);
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
MIGRAPH
X
_THROW
(
"builtin"
);
}
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
{
{
MIGRAPH_THROW
(
"builtin"
);
MIGRAPH
X
_THROW
(
"builtin"
);
}
}
};
};
...
@@ -36,7 +36,7 @@ struct outline
...
@@ -36,7 +36,7 @@ struct outline
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
return
s
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
return
s
;
}
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
{
{
MIGRAPH_THROW
(
"builtin"
);
MIGRAPH
X
_THROW
(
"builtin"
);
}
}
};
};
...
@@ -51,10 +51,10 @@ struct param
...
@@ -51,10 +51,10 @@ struct param
}
}
std
::
string
name
()
const
{
return
"@param"
;
}
std
::
string
name
()
const
{
return
"@param"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
MIGRAPH_THROW
(
"builtin"
);
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
MIGRAPH
X
_THROW
(
"builtin"
);
}
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
{
{
MIGRAPH_THROW
(
"builtin"
);
MIGRAPH
X
_THROW
(
"builtin"
);
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
param
&
op
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
param
&
op
)
{
{
...
@@ -64,7 +64,7 @@ struct param
...
@@ -64,7 +64,7 @@ struct param
};
};
}
// namespace builtin
}
// namespace builtin
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/check_context.hpp
View file @
a5c1c7f6
#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
...
@@ -15,11 +15,19 @@ struct check_context
...
@@ -15,11 +15,19 @@ struct check_context
std
::
string
name
()
const
{
return
"check_context"
;
}
std
::
string
name
()
const
{
return
"check_context"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
return
{};
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
)
const
{
return
{};
}
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
{
this
->
check
(
ctx
);
return
{};
}
void
finalize
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
shape
>&
)
const
{
this
->
check
(
ctx
);
}
void
check
(
context
&
ctx
)
const
{
{
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
());
MIGRAPHX_THROW
(
std
::
string
(
"Unexpected context type: "
)
+
ctx
.
type_id
().
name
());
return
{};
}
}
};
};
...
@@ -27,7 +35,7 @@ struct check_context
...
@@ -27,7 +35,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 @
a5c1c7f6
#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,8 +46,8 @@ struct check_shapes
...
@@ -46,8 +46,8 @@ 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 @
a5c1c7f6
#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 @
a5c1c7f6
#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
;
...
@@ -119,6 +119,13 @@ struct concat_optimization
...
@@ -119,6 +119,13 @@ struct concat_optimization
return
(
*
this
).
private_detail_te_get_handle
().
get_concat
(
op
);
return
(
*
this
).
private_detail_te_get_handle
().
get_concat
(
op
);
}
}
friend
bool
is_shared
(
const
concat_optimization
&
private_detail_x
,
const
concat_optimization
&
private_detail_y
)
{
return
private_detail_x
.
private_detail_te_handle_mem_var
==
private_detail_y
.
private_detail_te_handle_mem_var
;
}
private:
private:
struct
private_detail_te_handle_base_type
struct
private_detail_te_handle_base_type
{
{
...
@@ -235,7 +242,8 @@ inline const ValueType& any_cast(const concat_optimization& x)
...
@@ -235,7 +242,8 @@ inline const ValueType& any_cast(const concat_optimization& x)
}
}
#endif
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/include/migraphx/config.hpp
View file @
a5c1c7f6
#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 @
a5c1c7f6
#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 @
a5c1c7f6
#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
...
@@ -95,7 +95,13 @@ struct context
...
@@ -95,7 +95,13 @@ struct context
void
finish
()
const
void
finish
()
const
{
{
assert
((
*
this
).
private_detail_te_handle_mem_var
);
assert
((
*
this
).
private_detail_te_handle_mem_var
);
return
(
*
this
).
private_detail_te_get_handle
().
finish
();
(
*
this
).
private_detail_te_get_handle
().
finish
();
}
friend
bool
is_shared
(
const
context
&
private_detail_x
,
const
context
&
private_detail_y
)
{
return
private_detail_x
.
private_detail_te_handle_mem_var
==
private_detail_y
.
private_detail_te_handle_mem_var
;
}
}
private:
private:
...
@@ -136,7 +142,7 @@ struct context
...
@@ -136,7 +142,7 @@ struct context
const
std
::
type_info
&
type
()
const
override
{
return
typeid
(
private_detail_te_value
);
}
const
std
::
type_info
&
type
()
const
override
{
return
typeid
(
private_detail_te_value
);
}
void
finish
()
const
override
{
return
private_detail_te_value
.
finish
();
}
void
finish
()
const
override
{
private_detail_te_value
.
finish
();
}
PrivateDetailTypeErasedT
private_detail_te_value
;
PrivateDetailTypeErasedT
private_detail_te_value
;
};
};
...
@@ -205,7 +211,7 @@ inline const ValueType& any_cast(const context& x)
...
@@ -205,7 +211,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 @
a5c1c7f6
#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 @
a5c1c7f6
#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 @
a5c1c7f6
#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 @
a5c1c7f6
#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 @
a5c1c7f6
#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 @
a5c1c7f6
#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
Prev
1
2
3
4
5
6
…
16
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