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
cf02b661
"tests/nn/vscode:/vscode.git/clone" did not exist on "54bd62d33014a42803bdf20b0ad6fbc02333d943"
Commit
cf02b661
authored
Jun 19, 2023
by
Artur Wojcik
Browse files
workaround
parent
a7ecf8bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+12
-1
src/targets/gpu/prefuse_ops.cpp
src/targets/gpu/prefuse_ops.cpp
+9
-0
No files found.
src/targets/cpu/lowering.cpp
View file @
cf02b661
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
*/
*/
#include <migraphx/cpu/lowering.hpp>
#include <migraphx/cpu/lowering.hpp>
#if !defined(_MSC_VER)
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/op/identity.hpp>
#include <migraphx/op/identity.hpp>
...
@@ -51,12 +52,15 @@
...
@@ -51,12 +52,15 @@
#include <migraphx/cpu/context.hpp>
#include <migraphx/cpu/context.hpp>
#include <migraphx/register_op.hpp>
#include <migraphx/register_op.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/make_op.hpp>
#endif
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#if !defined(_MSC_VER)
#include <migraphx/tune_axis.hpp>
#include <migraphx/tune_axis.hpp>
#include <migraphx/match/layernorm.hpp>
#include <migraphx/match/layernorm.hpp>
#include <migraphx/match/gelu_erf.hpp>
#include <migraphx/match/gelu_erf.hpp>
#include <migraphx/match/gelu_tanh.hpp>
#include <migraphx/match/gelu_tanh.hpp>
#include <migraphx/matcher.hpp>
#include <migraphx/matcher.hpp>
#endif
#include <unordered_map>
#include <unordered_map>
#include <utility>
#include <utility>
#include <iostream>
#include <iostream>
...
@@ -65,6 +69,7 @@ namespace migraphx {
...
@@ -65,6 +69,7 @@ namespace migraphx {
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
cpu
{
namespace
cpu
{
#if !defined(_MSC_VER)
template
<
typename
T
>
template
<
typename
T
>
T
zero
(
const
T
&
)
T
zero
(
const
T
&
)
{
{
...
@@ -445,8 +450,14 @@ struct cpu_apply
...
@@ -445,8 +450,14 @@ struct cpu_apply
return
modl
->
insert_instruction
(
ins
,
make_op
(
"allocate"
,
{{
"shape"
,
to_value
(
s
)}}));
return
modl
->
insert_instruction
(
ins
,
make_op
(
"allocate"
,
{{
"shape"
,
to_value
(
s
)}}));
}
}
};
};
#endif
void
lowering
::
apply
(
module
&
m
)
const
{
cpu_apply
{
&
m
}.
apply
();
}
void
lowering
::
apply
(
module
&
m
)
const
{
#if !defined(_MSC_VER)
cpu_apply
{
&
m
}.
apply
();
#endif
}
}
// namespace cpu
}
// namespace cpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/targets/gpu/prefuse_ops.cpp
View file @
cf02b661
...
@@ -22,16 +22,22 @@
...
@@ -22,16 +22,22 @@
* THE SOFTWARE.
* THE SOFTWARE.
*/
*/
#include <migraphx/gpu/prefuse_ops.hpp>
#include <migraphx/gpu/prefuse_ops.hpp>
#if !defined(_MSC_VER)
#include <migraphx/match/layernorm.hpp>
#include <migraphx/match/layernorm.hpp>
#include <migraphx/check_shapes.hpp>
#include <migraphx/check_shapes.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/register_op.hpp>
#include <migraphx/register_op.hpp>
#endif
#include <migraphx/pass_manager.hpp>
#include <migraphx/pass_manager.hpp>
#if !defined(_MSC_VER)
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/dead_code_elimination.hpp>
#endif
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
#if !defined(_MSC_VER)
namespace
{
namespace
{
template
<
class
Derived
,
std
::
size_t
N
>
template
<
class
Derived
,
std
::
size_t
N
>
...
@@ -118,12 +124,15 @@ struct find_add_layernorm
...
@@ -118,12 +124,15 @@ struct find_add_layernorm
}
}
};
};
}
// namespace
}
// namespace
#endif
void
prefuse_ops
::
apply
(
module_pass_manager
&
mpm
)
const
void
prefuse_ops
::
apply
(
module_pass_manager
&
mpm
)
const
{
{
#if !defined(_MSC_VER)
match
::
find_matches
(
mpm
.
get_module
(),
find_layernorm
{});
match
::
find_matches
(
mpm
.
get_module
(),
find_layernorm
{});
mpm
.
run_pass
(
dead_code_elimination
{});
mpm
.
run_pass
(
dead_code_elimination
{});
match
::
find_matches
(
mpm
.
get_module
(),
find_add_layernorm
{});
match
::
find_matches
(
mpm
.
get_module
(),
find_add_layernorm
{});
#endif
}
}
}
// namespace gpu
}
// namespace gpu
...
...
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