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
bb390b65
"git@developer.sourcefind.cn:lacacy/qwen_lmdeploy.git" did not exist on "594fa51531c372ad65b5a6836b4f6a7c4071c3e6"
Commit
bb390b65
authored
Nov 28, 2018
by
Shucai Xiao
Browse files
Merge branch 'activationOperators' into addLogExpOperators
parents
adfa1a93
682ad83a
Changes
195
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
74 additions
and
74 deletions
+74
-74
src/opt/memory_coloring.cpp
src/opt/memory_coloring.cpp
+3
-3
src/opt/memory_coloring_impl.cpp
src/opt/memory_coloring_impl.cpp
+11
-11
src/opt/memory_coloring_impl.hpp
src/opt/memory_coloring_impl.hpp
+7
-7
src/program.cpp
src/program.cpp
+10
-10
src/shape.cpp
src/shape.cpp
+6
-6
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+2
-2
src/simplify_reshapes.cpp
src/simplify_reshapes.cpp
+2
-2
src/targets/cpu/gemm.cpp
src/targets/cpu/gemm.cpp
+2
-2
src/targets/cpu/include/migraphx/cpu/context.hpp
src/targets/cpu/include/migraphx/cpu/context.hpp
+4
-4
src/targets/cpu/include/migraphx/cpu/gemm.hpp
src/targets/cpu/include/migraphx/cpu/gemm.hpp
+4
-4
src/targets/cpu/include/migraphx/cpu/lowering.hpp
src/targets/cpu/include/migraphx/cpu/lowering.hpp
+4
-4
src/targets/cpu/include/migraphx/cpu/target.hpp
src/targets/cpu/include/migraphx/cpu/target.hpp
+4
-4
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+2
-2
src/targets/cpu/target.cpp
src/targets/cpu/target.cpp
+2
-2
src/targets/gpu/CMakeLists.txt
src/targets/gpu/CMakeLists.txt
+1
-1
src/targets/gpu/abs.cpp
src/targets/gpu/abs.cpp
+2
-2
src/targets/gpu/acos.cpp
src/targets/gpu/acos.cpp
+2
-2
src/targets/gpu/add.cpp
src/targets/gpu/add.cpp
+2
-2
src/targets/gpu/asin.cpp
src/targets/gpu/asin.cpp
+2
-2
src/targets/gpu/atan.cpp
src/targets/gpu/atan.cpp
+2
-2
No files found.
src/opt/memory_coloring.cpp
View file @
bb390b65
...
@@ -2,16 +2,16 @@
...
@@ -2,16 +2,16 @@
#include "memory_coloring_impl.hpp"
#include "memory_coloring_impl.hpp"
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
void
memory_coloring
::
apply
(
program
&
p
)
const
void
memory_coloring
::
apply
(
program
&
p
)
const
{
{
if
(
!
enabled
(
MIGRAPH_DISABLE_MEMORY_COLORING
{}))
if
(
!
enabled
(
MIGRAPH
X
_DISABLE_MEMORY_COLORING
{}))
{
{
memory_coloring_impl
opt
(
&
p
,
allocation_op
,
verify
);
memory_coloring_impl
opt
(
&
p
,
allocation_op
,
verify
);
opt
.
run
();
opt
.
run
();
}
}
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/opt/memory_coloring_impl.cpp
View file @
bb390b65
#include "memory_coloring_impl.hpp"
#include "memory_coloring_impl.hpp"
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
void
memory_coloring_impl
::
run
()
void
memory_coloring_impl
::
run
()
{
{
MIGRAPH_DEBUG
(
dump
(
"---Before memory coloring---"
));
MIGRAPH
X
_DEBUG
(
dump
(
"---Before memory coloring---"
));
MIGRAPH_DEBUG
(
dump_program
());
MIGRAPH
X
_DEBUG
(
dump_program
());
build
();
build
();
if
(
num_of_lives
!=
0
)
if
(
num_of_lives
!=
0
)
{
{
MIGRAPH_DEBUG
(
dump_intervals
());
MIGRAPH
X
_DEBUG
(
dump_intervals
());
// Coloring
// Coloring
while
(
!
alloc_queue
.
empty
())
while
(
!
alloc_queue
.
empty
())
{
{
...
@@ -85,7 +85,7 @@ bool memory_coloring_impl::allocate(interval_ptr interval)
...
@@ -85,7 +85,7 @@ bool memory_coloring_impl::allocate(interval_ptr interval)
conflict_queue
.
pop
();
conflict_queue
.
pop
();
}
}
segment
.
offset
=
offset
;
segment
.
offset
=
offset
;
MIGRAPH_DEBUG
(
segment
.
dump
());
MIGRAPH
X
_DEBUG
(
segment
.
dump
());
required_bytes
=
std
::
max
(
required_bytes
,
offset
+
segment
.
size
);
required_bytes
=
std
::
max
(
required_bytes
,
offset
+
segment
.
size
);
return
true
;
return
true
;
}
}
...
@@ -218,8 +218,8 @@ void memory_coloring_impl::rewrite()
...
@@ -218,8 +218,8 @@ void memory_coloring_impl::rewrite()
}
}
}
}
}
}
MIGRAPH_DEBUG
(
dump
(
"---After rewrite---"
));
MIGRAPH
X
_DEBUG
(
dump
(
"---After rewrite---"
));
MIGRAPH_DEBUG
(
dump_program
());
MIGRAPH
X
_DEBUG
(
dump_program
());
}
}
void
memory_coloring_impl
::
verify
()
void
memory_coloring_impl
::
verify
()
...
@@ -235,7 +235,7 @@ void memory_coloring_impl::verify()
...
@@ -235,7 +235,7 @@ void memory_coloring_impl::verify()
{
{
// TODO: This check breaks on the tests
// TODO: This check breaks on the tests
// if(!interval.is_live_on_entry)
// if(!interval.is_live_on_entry)
// MIGRAPH_THROW("interval is not live on entry");
// MIGRAPH
X
_THROW("interval is not live on entry");
continue
;
continue
;
}
}
...
@@ -253,14 +253,14 @@ void memory_coloring_impl::verify()
...
@@ -253,14 +253,14 @@ void memory_coloring_impl::verify()
if
(
range
->
offset
==
invalid_offset
)
if
(
range
->
offset
==
invalid_offset
)
continue
;
continue
;
if
(
!
is_disjoin
(
*
range
,
segment
))
if
(
!
is_disjoin
(
*
range
,
segment
))
MIGRAPH_THROW
(
"range and segment is not disjoined"
);
MIGRAPH
X
_THROW
(
"range and segment is not disjoined"
);
}
}
}
}
}
}
}
}
}
}
#ifdef MIGRAPH_DEBUG_OPT
#ifdef MIGRAPH
X
_DEBUG_OPT
void
memory_coloring_impl
::
dump
(
const
std
::
string
&
str
)
{
std
::
cout
<<
str
<<
std
::
endl
;
}
void
memory_coloring_impl
::
dump
(
const
std
::
string
&
str
)
{
std
::
cout
<<
str
<<
std
::
endl
;
}
...
@@ -334,5 +334,5 @@ void live_interval::dump()
...
@@ -334,5 +334,5 @@ void live_interval::dump()
#endif
#endif
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/opt/memory_coloring_impl.hpp
View file @
bb390b65
#ifndef MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#define MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#include "common_header.hpp"
#include "common_header.hpp"
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
static
const
int
invalid_offset
=
-
1
;
static
const
int
invalid_offset
=
-
1
;
...
@@ -15,7 +15,7 @@ struct live_range
...
@@ -15,7 +15,7 @@ struct live_range
long
long
offset
;
// offset to base pointer of allocated memory trunk.
long
long
offset
;
// offset to base pointer of allocated memory trunk.
int
vn
;
// value number that identifies this live_range.
int
vn
;
// value number that identifies this live_range.
long
long
size
;
// size of required memory in bytes
long
long
size
;
// size of required memory in bytes
#ifdef MIGRAPH_DEBUG_OPT
#ifdef MIGRAPH
X
_DEBUG_OPT
void
dump
();
void
dump
();
#endif
#endif
};
};
...
@@ -35,7 +35,7 @@ struct live_interval
...
@@ -35,7 +35,7 @@ struct live_interval
int
get_end
()
const
{
return
segment
.
end
;
}
int
get_end
()
const
{
return
segment
.
end
;
}
long
long
get_offset
()
const
{
return
segment
.
offset
;
}
long
long
get_offset
()
const
{
return
segment
.
offset
;
}
#ifdef MIGRAPH_DEBUG_OPT
#ifdef MIGRAPH
X
_DEBUG_OPT
void
dump
();
void
dump
();
#endif
#endif
...
@@ -101,7 +101,7 @@ struct memory_coloring_impl
...
@@ -101,7 +101,7 @@ struct memory_coloring_impl
return
((
end1
<
range2
.
offset
)
||
(
end2
<
range1
.
offset
));
return
((
end1
<
range2
.
offset
)
||
(
end2
<
range1
.
offset
));
}
}
void
verify
();
void
verify
();
#ifdef MIGRAPH_DEBUG_OPT
#ifdef MIGRAPH
X
_DEBUG_OPT
void
dump
(
const
std
::
string
&
);
void
dump
(
const
std
::
string
&
);
void
dump_program
();
void
dump_program
();
void
dump_intervals
();
void
dump_intervals
();
...
@@ -154,6 +154,6 @@ struct memory_coloring_impl
...
@@ -154,6 +154,6 @@ struct memory_coloring_impl
bool
enable_verify
;
bool
enable_verify
;
};
};
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/program.cpp
View file @
bb390b65
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_TRACE_COMPILE
)
MIGRAPH
X
_DECLARE_ENV_VAR
(
MIGRAPH
X
_TRACE_COMPILE
)
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_TRACE_EVAL
)
MIGRAPH
X
_DECLARE_ENV_VAR
(
MIGRAPH
X
_TRACE_EVAL
)
struct
program_impl
struct
program_impl
{
{
...
@@ -282,7 +282,7 @@ void program::compile(const target& t, tracer trace)
...
@@ -282,7 +282,7 @@ void program::compile(const target& t, tracer trace)
{
{
assert
(
this
->
validate
()
==
impl
->
instructions
.
end
());
assert
(
this
->
validate
()
==
impl
->
instructions
.
end
());
this
->
impl
->
ctx
=
t
.
get_context
();
this
->
impl
->
ctx
=
t
.
get_context
();
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
if
(
enabled
(
MIGRAPH
X
_TRACE_COMPILE
{}))
trace
=
tracer
{
std
::
cout
};
trace
=
tracer
{
std
::
cout
};
trace
(
*
this
);
trace
(
*
this
);
trace
();
trace
();
...
@@ -297,8 +297,8 @@ void program::compile(const target& t, tracer trace)
...
@@ -297,8 +297,8 @@ void program::compile(const target& t, tracer trace)
if
(
invalid
!=
impl
->
instructions
.
end
())
if
(
invalid
!=
impl
->
instructions
.
end
())
{
{
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
MIGRAPH_THROW
(
p
.
name
()
+
" pass produces invalid program at instruction "
+
MIGRAPH
X
_THROW
(
p
.
name
()
+
" pass produces invalid program at instruction "
+
std
::
to_string
(
index
)
+
": "
+
invalid
->
name
());
std
::
to_string
(
index
)
+
": "
+
invalid
->
name
());
}
}
trace
();
trace
();
#endif
#endif
...
@@ -307,7 +307,7 @@ void program::compile(const target& t, tracer trace)
...
@@ -307,7 +307,7 @@ void program::compile(const target& t, tracer trace)
if
(
invalid
!=
impl
->
instructions
.
end
())
if
(
invalid
!=
impl
->
instructions
.
end
())
{
{
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
MIGRAPH_THROW
(
"Invalid program from compilation at instruction "
+
std
::
to_string
(
index
));
MIGRAPH
X
_THROW
(
"Invalid program from compilation at instruction "
+
std
::
to_string
(
index
));
}
}
}
}
...
@@ -334,7 +334,7 @@ argument generic_eval(const program& p,
...
@@ -334,7 +334,7 @@ argument generic_eval(const program& p,
auto
param_name
=
auto
param_name
=
any_cast
<
builtin
::
param
>
(
ins
->
get_operator
()).
parameter
;
any_cast
<
builtin
::
param
>
(
ins
->
get_operator
()).
parameter
;
if
(
not
contains
(
params
,
param_name
))
if
(
not
contains
(
params
,
param_name
))
MIGRAPH_THROW
(
"Parameter not found: "
+
param_name
);
MIGRAPH
X
_THROW
(
"Parameter not found: "
+
param_name
);
return
params
.
at
(
param_name
);
return
params
.
at
(
param_name
);
}));
}));
}
}
...
@@ -361,7 +361,7 @@ argument generic_eval(const program& p,
...
@@ -361,7 +361,7 @@ argument generic_eval(const program& p,
argument
program
::
eval
(
std
::
unordered_map
<
std
::
string
,
argument
>
params
)
const
argument
program
::
eval
(
std
::
unordered_map
<
std
::
string
,
argument
>
params
)
const
{
{
if
(
enabled
(
MIGRAPH_TRACE_EVAL
{}))
if
(
enabled
(
MIGRAPH
X
_TRACE_EVAL
{}))
{
{
auto
&
ctx
=
this
->
impl
->
ctx
;
auto
&
ctx
=
this
->
impl
->
ctx
;
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[
&
](
auto
&
ins
,
auto
f
)
{
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[
&
](
auto
&
ins
,
auto
f
)
{
...
@@ -501,5 +501,5 @@ std::ostream& operator<<(std::ostream& os, const program& p)
...
@@ -501,5 +501,5 @@ std::ostream& operator<<(std::ostream& os, const program& p)
return
os
;
return
os
;
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/shape.cpp
View file @
bb390b65
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <iostream>
#include <iostream>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
shape_impl
struct
shape_impl
{
{
...
@@ -169,12 +169,12 @@ std::string shape::type_string() const
...
@@ -169,12 +169,12 @@ std::string shape::type_string() const
{
{
switch
(
this
->
type
())
switch
(
this
->
type
())
{
{
#define MIGRAPH_SHAPE_TYPE_STRING_CASE(x, t) \
#define MIGRAPH
X
_SHAPE_TYPE_STRING_CASE(x, t) \
case x: return #x;
case x: return #x;
MIGRAPH_SHAPE_VISIT_TYPES
(
MIGRAPH_SHAPE_TYPE_STRING_CASE
)
MIGRAPH
X
_SHAPE_VISIT_TYPES
(
MIGRAPH
X
_SHAPE_TYPE_STRING_CASE
)
#undef MIGRAPH_SHAPE_TYPE_STRING_CASE
#undef MIGRAPH
X
_SHAPE_TYPE_STRING_CASE
}
}
MIGRAPH_THROW
(
"Invalid type"
);
MIGRAPH
X
_THROW
(
"Invalid type"
);
}
}
bool
operator
==
(
const
shape
&
x
,
const
shape
&
y
)
bool
operator
==
(
const
shape
&
x
,
const
shape
&
y
)
...
@@ -191,5 +191,5 @@ std::ostream& operator<<(std::ostream& os, const shape& x)
...
@@ -191,5 +191,5 @@ std::ostream& operator<<(std::ostream& os, const shape& x)
return
os
;
return
os
;
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/simplify_algebra.cpp
View file @
bb390b65
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include <migraphx/literal.hpp>
#include <migraphx/literal.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
struct
find_add_lit_broadcast
struct
find_add_lit_broadcast
{
{
...
@@ -61,5 +61,5 @@ struct find_add_lit_broadcast
...
@@ -61,5 +61,5 @@ struct find_add_lit_broadcast
void
simplify_algebra
::
apply
(
program
&
p
)
const
{
match
::
find_matches
(
p
,
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
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/simplify_reshapes.cpp
View file @
bb390b65
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <unordered_set>
#include <unordered_set>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
bool
is_reshaper
(
const
std
::
string
&
name
)
bool
is_reshaper
(
const
std
::
string
&
name
)
{
{
...
@@ -60,5 +60,5 @@ void simplify_reshapes::apply(program& p) const
...
@@ -60,5 +60,5 @@ void simplify_reshapes::apply(program& p) const
}
}
}
}
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/cpu/gemm.cpp
View file @
bb390b65
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include <blaze/math/CustomMatrix.h>
#include <blaze/math/CustomMatrix.h>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
template
<
class
T
>
template
<
class
T
>
...
@@ -94,5 +94,5 @@ void migemm(
...
@@ -94,5 +94,5 @@ void migemm(
}
}
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/cpu/include/migraphx/cpu/context.hpp
View file @
bb390b65
#ifndef MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONTEXT_HPP
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
struct
context
struct
context
...
@@ -13,7 +13,7 @@ struct context
...
@@ -13,7 +13,7 @@ struct context
};
};
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/cpu/include/migraphx/cpu/gemm.hpp
View file @
bb390b65
#ifndef MIGRAPH_GUARD_RTGLIB_CPU_GEMM_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CPU_GEMM_HPP
#define MIGRAPH_GUARD_RTGLIB_CPU_GEMM_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CPU_GEMM_HPP
#include <migraphx/argument.hpp>
#include <migraphx/argument.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
void
migemm
(
void
migemm
(
const
argument
&
c_arg
,
const
argument
&
a_arg
,
const
argument
&
b_arg
,
float
alpha
,
float
beta
);
const
argument
&
c_arg
,
const
argument
&
a_arg
,
const
argument
&
b_arg
,
float
alpha
,
float
beta
);
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/cpu/include/migraphx/cpu/lowering.hpp
View file @
bb390b65
#ifndef MIGRAPH_GUARD_RTGLIB_CPU_LOWERING_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CPU_LOWERING_HPP
#define MIGRAPH_GUARD_RTGLIB_CPU_LOWERING_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CPU_LOWERING_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
{
namespace
cpu
{
namespace
cpu
{
struct
lowering
struct
lowering
...
@@ -15,7 +15,7 @@ struct lowering
...
@@ -15,7 +15,7 @@ struct lowering
};
};
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/cpu/include/migraphx/cpu/target.hpp
View file @
bb390b65
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_CPU_TARGET_HPP
#ifndef MIGRAPH
X
_GUARD_MIGRAPHLIB_CPU_TARGET_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_CPU_TARGET_HPP
#define MIGRAPH
X
_GUARD_MIGRAPHLIB_CPU_TARGET_HPP
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#include <migraphx/cpu/context.hpp>
#include <migraphx/cpu/context.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
struct
target
struct
target
...
@@ -17,7 +17,7 @@ struct target
...
@@ -17,7 +17,7 @@ struct target
};
};
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/cpu/lowering.cpp
View file @
bb390b65
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
template
<
typename
T
>
template
<
typename
T
>
...
@@ -712,5 +712,5 @@ struct cpu_apply
...
@@ -712,5 +712,5 @@ struct cpu_apply
void
lowering
::
apply
(
program
&
p
)
const
{
cpu_apply
{
&
p
}.
apply
();
}
void
lowering
::
apply
(
program
&
p
)
const
{
cpu_apply
{
&
p
}.
apply
();
}
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/cpu/target.cpp
View file @
bb390b65
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include <migraphx/auto_contiguous.hpp>
#include <migraphx/auto_contiguous.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
std
::
string
target
::
name
()
const
{
return
"cpu"
;
}
std
::
string
target
::
name
()
const
{
return
"cpu"
;
}
...
@@ -15,5 +15,5 @@ std::vector<pass> target::get_passes(migraphx::context&) const
...
@@ -15,5 +15,5 @@ std::vector<pass> target::get_passes(migraphx::context&) const
}
}
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/CMakeLists.txt
View file @
bb390b65
...
@@ -29,7 +29,7 @@ add_library(migraphx_device
...
@@ -29,7 +29,7 @@ add_library(migraphx_device
)
)
set_target_properties
(
migraphx_device PROPERTIES EXPORT_NAME device
)
set_target_properties
(
migraphx_device PROPERTIES EXPORT_NAME device
)
rocm_clang_tidy_check
(
migraphx_device
)
rocm_clang_tidy_check
(
migraphx_device
)
target_link_libraries
(
migraphx_device migraphx hip::device -Wno-invalid-command-line-argument -amdgpu-target=gfx803 -amdgpu-target=gfx900 -amdgpu-target=gfx90
3
)
target_link_libraries
(
migraphx_device migraphx hip::device -Wno-invalid-command-line-argument -amdgpu-target=gfx803 -amdgpu-target=gfx900 -amdgpu-target=gfx90
6
)
target_include_directories
(
migraphx_device PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
target_include_directories
(
migraphx_device PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
target_include_directories
(
migraphx_device PRIVATE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/device/include>
)
target_include_directories
(
migraphx_device PRIVATE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/device/include>
)
...
...
src/targets/gpu/abs.cpp
View file @
bb390b65
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
shape
miopen_abs
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
miopen_abs
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
...
@@ -34,5 +34,5 @@ argument miopen_abs::compute(context& ctx,
...
@@ -34,5 +34,5 @@ argument miopen_abs::compute(context& ctx,
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/acos.cpp
View file @
bb390b65
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
shape
hip_acos
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
hip_acos
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
...
@@ -22,5 +22,5 @@ argument hip_acos::compute(context& ctx, const shape&, const std::vector<argumen
...
@@ -22,5 +22,5 @@ argument hip_acos::compute(context& ctx, const shape&, const std::vector<argumen
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/add.cpp
View file @
bb390b65
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
shape
hip_add
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
hip_add
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
...
@@ -51,5 +51,5 @@ argument miopen_add::compute(context& ctx,
...
@@ -51,5 +51,5 @@ argument miopen_add::compute(context& ctx,
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/asin.cpp
View file @
bb390b65
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
shape
hip_asin
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
hip_asin
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
...
@@ -22,5 +22,5 @@ argument hip_asin::compute(context& ctx, const shape&, const std::vector<argumen
...
@@ -22,5 +22,5 @@ argument hip_asin::compute(context& ctx, const shape&, const std::vector<argumen
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/atan.cpp
View file @
bb390b65
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
shape
hip_atan
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
hip_atan
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
...
@@ -22,5 +22,5 @@ argument hip_atan::compute(context& ctx, const shape&, const std::vector<argumen
...
@@ -22,5 +22,5 @@ argument hip_atan::compute(context& ctx, const shape&, const std::vector<argumen
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
Prev
1
2
3
4
5
6
7
8
9
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