Commit 687cd084 authored by Paul's avatar Paul
Browse files

Update

parent d362aa6e
#include <migraphx/partition.hpp> #include <migraphx/partition.hpp>
#include <migraphx/program.hpp> #include <migraphx/program.hpp>
#include <migraphx/register_op.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
...@@ -10,11 +11,22 @@ struct partition_op ...@@ -10,11 +11,22 @@ struct partition_op
std::string name() const { return "partition"; } std::string name() const { return "partition"; }
// TODO: Implement compute_shape and compute // TODO: Implement compute_shape and compute
}; };
MIGRAPHX_REGISTER_OP(partition_op);
void partition(program& p, void partition(program& p,
module& root, module& root,
const std::unordered_map<instruction_ref, std::string>& assignments) const std::unordered_map<instruction_ref, std::string>& assignments)
{ {
// Group instructions based on label
// TODO: Recurse traverse submodule from root
for(auto ins:iterator_for(root))
{
// Rough idea of inserting submodules
std::string label;
auto sm = p.create_module(label);
root.add_instruction(partition_op{label}, {}, {sm});
}
} }
} // namespace MIGRAPHX_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment