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
e40a8f31
Commit
e40a8f31
authored
Sep 13, 2018
by
mei-ye
Browse files
merge with master
parent
ab567439
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
12 deletions
+34
-12
src/targets/gpu/target.cpp
src/targets/gpu/target.cpp
+4
-4
src/targets/gpu/write_literals.cpp
src/targets/gpu/write_literals.cpp
+2
-4
test/auto_contiguous_test.cpp
test/auto_contiguous_test.cpp
+1
-1
test/dead_code_elimination_test.cpp
test/dead_code_elimination_test.cpp
+1
-1
test/eliminate_allocation_test.cpp
test/eliminate_allocation_test.cpp
+1
-1
test/memory_coloring_test.cpp
test/memory_coloring_test.cpp
+24
-0
test/simplify_reshapes_test.cpp
test/simplify_reshapes_test.cpp
+1
-1
No files found.
src/targets/gpu/target.cpp
View file @
e40a8f31
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
namespace
migraph
{
namespace
migraph
{
namespace
gpu
{
namespace
gpu
{
std
::
vector
<
pass
>
target
::
get_passes
(
migraph
::
context
&
gctx
)
const
std
::
vector
<
pass
>
target
::
get_passes
(
migraph
::
context
&
gctx
)
const
{
{
auto
&
ctx
=
any_cast
<
context
>
(
gctx
);
auto
&
ctx
=
any_cast
<
context
>
(
gctx
);
...
@@ -50,9 +50,9 @@ std::string target::name() const { return "miopen"; }
...
@@ -50,9 +50,9 @@ std::string target::name() const { return "miopen"; }
migraph
::
context
target
::
get_context
(
parameter_map
params
)
const
migraph
::
context
target
::
get_context
(
parameter_map
params
)
const
{
{
return
context
{
share
(
make_obj
<
miopen_handle
>
(
&
miopenCreate
)),
return
context
{
share
(
make_obj
<
miopen_handle
>
(
&
miopenCreate
)),
share
(
create_rocblas_handle_ptr
()),
params
,
{}};
share
(
create_rocblas_handle_ptr
()),
params
,
{}};
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace migraph
}
// namespace migraph
src/targets/gpu/write_literals.cpp
View file @
e40a8f31
...
@@ -26,9 +26,9 @@ struct hip_load_literal
...
@@ -26,9 +26,9 @@ struct hip_load_literal
void
write_literals
::
apply
(
program
&
p
)
const
void
write_literals
::
apply
(
program
&
p
)
const
{
{
if
(
!
enabled
(
MIGRAPH_DISABLE_MEMORY_COLORING
{}))
if
(
!
enabled
(
MIGRAPH_DISABLE_MEMORY_COLORING
{}))
return
;
return
;
assert
(
ctx
!=
nullptr
);
assert
(
ctx
!=
nullptr
);
for
(
auto
ins
:
iterator_for
(
p
))
for
(
auto
ins
:
iterator_for
(
p
))
{
{
...
@@ -41,7 +41,5 @@ void write_literals::apply(program& p) const
...
@@ -41,7 +41,5 @@ void write_literals::apply(program& p) const
}
}
}
}
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace migraph
}
// namespace migraph
test/auto_contiguous_test.cpp
View file @
e40a8f31
...
@@ -10,7 +10,7 @@ struct contiguous_target
...
@@ -10,7 +10,7 @@ struct contiguous_target
{
{
return
{
migraph
::
auto_contiguous
{}};
return
{
migraph
::
auto_contiguous
{}};
}
}
migraph
::
context
get_context
()
const
{
return
{};
}
migraph
::
context
get_context
(
migraph
::
parameter_map
)
const
{
return
{};
}
};
};
void
literal_broadcast
()
void
literal_broadcast
()
...
...
test/dead_code_elimination_test.cpp
View file @
e40a8f31
...
@@ -9,7 +9,7 @@ struct dce_target
...
@@ -9,7 +9,7 @@ struct dce_target
{
{
return
{
migraph
::
dead_code_elimination
{}};
return
{
migraph
::
dead_code_elimination
{}};
}
}
migraph
::
context
get_context
()
const
{
return
{};
}
migraph
::
context
get_context
(
migraph
::
parameter_map
)
const
{
return
{};
}
};
};
void
simple_test
()
void
simple_test
()
...
...
test/eliminate_allocation_test.cpp
View file @
e40a8f31
...
@@ -12,7 +12,7 @@ struct eliminate_allocation_target
...
@@ -12,7 +12,7 @@ struct eliminate_allocation_target
{
{
return
{
migraph
::
eliminate_allocation
{
"allocate"
,
align
},
migraph
::
dead_code_elimination
{}};
return
{
migraph
::
eliminate_allocation
{
"allocate"
,
align
},
migraph
::
dead_code_elimination
{}};
}
}
migraph
::
context
get_context
()
const
{
return
{};
}
migraph
::
context
get_context
(
migraph
::
parameter_map
)
const
{
return
{};
}
};
};
struct
allocate
struct
allocate
...
...
test/memory_coloring_test.cpp
0 → 100644
View file @
e40a8f31
#include <migraph/memory_coloring.hpp>
#include <migraph/operators.hpp>
#include <basic_ops.hpp>
#include <test.hpp>
struct
memory_coloring_target
{
std
::
string
name
()
const
{
return
"memory_coloring"
;
}
std
::
vector
<
migraph
::
pass
>
get_passes
(
migraph
::
context
&
)
const
{
return
{
migraph
::
memory_coloring
{}};
}
migraph
::
context
get_context
(
migraph
::
parameter_map
)
const
{
return
{};
}
};
int
main
()
{
migraph
::
program
p
;
auto
l
=
p
.
add_literal
(
get_2x2
());
p
.
add_instruction
(
migraph
::
transpose
{{
1
,
0
}},
l
);
p
.
compile
(
memory_coloring_target
{});
EXPECT
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
16
);
}
test/simplify_reshapes_test.cpp
View file @
e40a8f31
...
@@ -11,7 +11,7 @@ struct simplify_reshapes_target
...
@@ -11,7 +11,7 @@ struct simplify_reshapes_target
{
{
return
{
migraph
::
simplify_reshapes
{},
migraph
::
dead_code_elimination
{}};
return
{
migraph
::
simplify_reshapes
{},
migraph
::
dead_code_elimination
{}};
}
}
migraph
::
context
get_context
()
const
{
return
{};
}
migraph
::
context
get_context
(
migraph
::
parameter_map
)
const
{
return
{};
}
};
};
void
double_contig
()
void
double_contig
()
...
...
Prev
1
2
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