Commit 96358e41 authored by Paul's avatar Paul
Browse files

Rename to migraphx

parent 80203608
...@@ -7,35 +7,35 @@ target_compile_options(onnx-proto PRIVATE -w) ...@@ -7,35 +7,35 @@ target_compile_options(onnx-proto PRIVATE -w)
target_link_libraries(onnx-proto PRIVATE ${PROTOBUF_LIBRARY}) target_link_libraries(onnx-proto PRIVATE ${PROTOBUF_LIBRARY})
set_target_properties(onnx-proto PROPERTIES POSITION_INDEPENDENT_CODE On) set_target_properties(onnx-proto PROPERTIES POSITION_INDEPENDENT_CODE On)
add_library(migraph_onnx onnx.cpp) add_library(migraphx_onnx onnx.cpp)
set_target_properties(migraph_onnx PROPERTIES EXPORT_NAME onnx) set_target_properties(migraphx_onnx PROPERTIES EXPORT_NAME onnx)
rocm_clang_tidy_check(migraph_onnx) rocm_clang_tidy_check(migraphx_onnx)
target_link_libraries(migraph_onnx PRIVATE onnx-proto) target_link_libraries(migraphx_onnx PRIVATE onnx-proto)
target_link_libraries(migraph_onnx PUBLIC migraph) target_link_libraries(migraphx_onnx PUBLIC migraphx)
rocm_install_targets( rocm_install_targets(
TARGETS migraph_onnx TARGETS migraphx_onnx
) )
add_executable(read_onnx read_onnx.cpp) add_executable(read_onnx read_onnx.cpp)
rocm_clang_tidy_check(read_onnx) rocm_clang_tidy_check(read_onnx)
target_link_libraries(read_onnx migraph_onnx) target_link_libraries(read_onnx migraphx_onnx)
if(MIGRAPH_ENABLE_GPU) if(MIGRAPH_ENABLE_GPU)
add_executable(mnist mnist.cpp) add_executable(mnist mnist.cpp)
rocm_clang_tidy_check(mnist) rocm_clang_tidy_check(mnist)
target_link_libraries(mnist migraph_cpu migraph_gpu migraph_onnx) target_link_libraries(mnist migraphx_cpu migraphx_gpu migraphx_onnx)
add_executable(cifar10 cifar10.cpp) add_executable(cifar10 cifar10.cpp)
rocm_clang_tidy_check(cifar10) rocm_clang_tidy_check(cifar10)
target_link_libraries(cifar10 migraph_cpu migraph_gpu migraph_onnx) target_link_libraries(cifar10 migraphx_cpu migraphx_gpu migraphx_onnx)
add_executable(verify_onnx verify_onnx.cpp) add_executable(verify_onnx verify_onnx.cpp)
rocm_clang_tidy_check(verify_onnx) rocm_clang_tidy_check(verify_onnx)
target_link_libraries(verify_onnx migraph_onnx migraph_cpu migraph_gpu) target_link_libraries(verify_onnx migraphx_onnx migraphx_cpu migraphx_gpu)
add_executable(perf_onnx perf_onnx.cpp) add_executable(perf_onnx perf_onnx.cpp)
rocm_clang_tidy_check(perf_onnx) rocm_clang_tidy_check(perf_onnx)
target_link_libraries(perf_onnx migraph_onnx migraph_cpu migraph_gpu) target_link_libraries(perf_onnx migraphx_onnx migraphx_cpu migraphx_gpu)
endif() endif()
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
#include <numeric> #include <numeric>
#include <stdexcept> #include <stdexcept>
#include <migraph/onnx.hpp> #include <migraphx/onnx.hpp>
#include <migraph/cpu/target.hpp> #include <migraphx/cpu/target.hpp>
#include <migraph/gpu/target.hpp> #include <migraphx/gpu/target.hpp>
#include <migraph/gpu/hip.hpp> #include <migraphx/gpu/hip.hpp>
#include <migraph/generate.hpp> #include <migraphx/generate.hpp>
#include "softmax.hpp" #include "softmax.hpp"
...@@ -53,19 +53,19 @@ int main(int argc, char const* argv[]) ...@@ -53,19 +53,19 @@ int main(int argc, char const* argv[])
std::string gpu_cpu = argv[1]; std::string gpu_cpu = argv[1];
std::string file = argv[2]; std::string file = argv[2];
std::string datafile = argv[3]; std::string datafile = argv[3];
auto prog = migraph::parse_onnx(file); auto prog = migraphx::parse_onnx(file);
std::cout << prog << std::endl; std::cout << prog << std::endl;
auto imageset = read_cifar10_images(datafile); auto imageset = read_cifar10_images(datafile);
if(gpu_cpu == "gpu") if(gpu_cpu == "gpu")
{ {
// GPU target // GPU target
prog.compile(migraph::gpu::target{}); prog.compile(migraphx::gpu::target{});
migraph::program::parameter_map m; migraphx::program::parameter_map m;
auto s = migraph::shape{migraph::shape::float_type, {1, 3, 32, 32}}; auto s = migraphx::shape{migraphx::shape::float_type, {1, 3, 32, 32}};
for(auto&& x : prog.get_parameter_shapes()) for(auto&& x : prog.get_parameter_shapes())
{ {
m[x.first] = migraph::gpu::to_gpu(migraph::generate_argument(x.second)); m[x.first] = migraphx::gpu::to_gpu(migraphx::generate_argument(x.second));
} }
auto labels = imageset.first; auto labels = imageset.first;
auto input = imageset.second; auto input = imageset.second;
...@@ -73,8 +73,8 @@ int main(int argc, char const* argv[]) ...@@ -73,8 +73,8 @@ int main(int argc, char const* argv[])
for(int i = 0; i < 10; i++) for(int i = 0; i < 10; i++)
{ {
std::cout << "label: " << static_cast<uint32_t>(labels[i]) << " ----> "; std::cout << "label: " << static_cast<uint32_t>(labels[i]) << " ----> ";
m["0"] = migraph::gpu::to_gpu(migraph::argument{s, &ptr[3072 * i]}); m["0"] = migraphx::gpu::to_gpu(migraphx::argument{s, &ptr[3072 * i]});
auto result = migraph::gpu::from_gpu(prog.eval(m)); auto result = migraphx::gpu::from_gpu(prog.eval(m));
std::vector<float> logits; std::vector<float> logits;
result.visit([&](auto output) { logits.assign(output.begin(), output.end()); }); result.visit([&](auto output) { logits.assign(output.begin(), output.end()); });
std::vector<float> probs = softmax<float>(logits); std::vector<float> probs = softmax<float>(logits);
...@@ -86,15 +86,15 @@ int main(int argc, char const* argv[]) ...@@ -86,15 +86,15 @@ int main(int argc, char const* argv[])
else else
{ {
// CPU target // CPU target
prog.compile(migraph::cpu::target{}); prog.compile(migraphx::cpu::target{});
auto s = migraph::shape{migraph::shape::float_type, {1, 3, 32, 32}}; auto s = migraphx::shape{migraphx::shape::float_type, {1, 3, 32, 32}};
auto labels = imageset.first; auto labels = imageset.first;
auto input = imageset.second; auto input = imageset.second;
auto ptr = input.data(); auto ptr = input.data();
for(int i = 0; i < 10; i++) for(int i = 0; i < 10; i++)
{ {
std::cout << "label: " << static_cast<uint32_t>(labels[i]) << " ----> "; std::cout << "label: " << static_cast<uint32_t>(labels[i]) << " ----> ";
auto input3 = migraph::argument{s, &ptr[3072 * i]}; auto input3 = migraphx::argument{s, &ptr[3072 * i]};
auto result = prog.eval({{"0", input3}}); auto result = prog.eval({{"0", input3}});
std::vector<float> logits; std::vector<float> logits;
result.visit([&](auto output) { logits.assign(output.begin(), output.end()); }); result.visit([&](auto output) { logits.assign(output.begin(), output.end()); });
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
#include <numeric> #include <numeric>
#include <stdexcept> #include <stdexcept>
#include <migraph/onnx.hpp> #include <migraphx/onnx.hpp>
#include <migraph/gpu/target.hpp> #include <migraphx/gpu/target.hpp>
#include <migraph/gpu/hip.hpp> #include <migraphx/gpu/hip.hpp>
#include <migraph/generate.hpp> #include <migraphx/generate.hpp>
#include "softmax.hpp" #include "softmax.hpp"
...@@ -113,20 +113,20 @@ int main(int argc, char const* argv[]) ...@@ -113,20 +113,20 @@ int main(int argc, char const* argv[])
std::vector<int32_t> labels = read_mnist_labels(labelfile, nlabels); std::vector<int32_t> labels = read_mnist_labels(labelfile, nlabels);
std::string file = argv[1]; std::string file = argv[1];
auto prog = migraph::parse_onnx(file); auto prog = migraphx::parse_onnx(file);
std::cout << prog << std::endl << std::endl; std::cout << prog << std::endl << std::endl;
prog.compile(migraph::gpu::target{}); prog.compile(migraphx::gpu::target{});
auto s = migraph::shape{migraph::shape::float_type, {1, 1, 28, 28}}; auto s = migraphx::shape{migraphx::shape::float_type, {1, 1, 28, 28}};
std::cout << s << std::endl; std::cout << s << std::endl;
auto ptr = input.data(); auto ptr = input.data();
migraph::program::parameter_map m; migraphx::program::parameter_map m;
m["output"] = m["output"] =
migraph::gpu::to_gpu(migraph::generate_argument(prog.get_parameter_shape("output"))); migraphx::gpu::to_gpu(migraphx::generate_argument(prog.get_parameter_shape("output")));
for(int i = 0; i < 20; i++) for(int i = 0; i < 20; i++)
{ {
std::cout << "label: " << labels[i] << " ----> "; std::cout << "label: " << labels[i] << " ----> ";
m["0"] = migraph::gpu::to_gpu(migraph::argument{s, &ptr[784 * i]}); m["0"] = migraphx::gpu::to_gpu(migraphx::argument{s, &ptr[784 * i]});
auto result = migraph::gpu::from_gpu(prog.eval(m)); auto result = migraphx::gpu::from_gpu(prog.eval(m));
std::vector<float> logits; std::vector<float> logits;
result.visit([&](auto output) { logits.assign(output.begin(), output.end()); }); result.visit([&](auto output) { logits.assign(output.begin(), output.end()); });
std::vector<float> probs = softmax(logits); std::vector<float> probs = softmax(logits);
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <migraph/fallthrough.hpp> #include <migraphx/fallthrough.hpp>
#include <migraph/program.hpp> #include <migraphx/program.hpp>
#include <migraph/operators.hpp> #include <migraphx/operators.hpp>
#include <migraph/ranges.hpp> #include <migraphx/ranges.hpp>
#include <migraph/instruction.hpp> #include <migraphx/instruction.hpp>
#include <migraph/config.hpp> #include <migraphx/config.hpp>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
struct unknown struct unknown
{ {
...@@ -406,12 +406,12 @@ struct onnx_parser ...@@ -406,12 +406,12 @@ struct onnx_parser
auto scale_val = prog.add_literal(scale); auto scale_val = prog.add_literal(scale);
auto bias_vals = prog.add_literal( auto bias_vals = prog.add_literal(
migraph::literal{migraph::shape{migraph::shape::float_type, {bias.size()}}, bias}); migraphx::literal{migraphx::shape{migraphx::shape::float_type, {bias.size()}}, bias});
auto scale_tensor = prog.add_instruction(migraph::op::scalar{input_shape}, scale_val); auto scale_tensor = prog.add_instruction(migraphx::op::scalar{input_shape}, scale_val);
auto img_scaled = prog.add_instruction(migraph::op::mul{}, args.front(), scale_tensor); auto img_scaled = prog.add_instruction(migraphx::op::mul{}, args.front(), scale_tensor);
auto bias_bcast = prog.add_instruction(migraph::op::broadcast{1, input_shape}, bias_vals); auto bias_bcast = prog.add_instruction(migraphx::op::broadcast{1, input_shape}, bias_vals);
return prog.add_instruction(migraph::op::add{}, img_scaled, bias_bcast); return prog.add_instruction(migraphx::op::add{}, img_scaled, bias_bcast);
} }
instruction_ref instruction_ref
...@@ -423,7 +423,7 @@ struct onnx_parser ...@@ -423,7 +423,7 @@ struct onnx_parser
auto&& perm_vals = attributes["perm"].ints(); auto&& perm_vals = attributes["perm"].ints();
perm = std::vector<int64_t>(perm_vals.begin(), perm_vals.end()); perm = std::vector<int64_t>(perm_vals.begin(), perm_vals.end());
} }
return prog.add_instruction(migraph::op::transpose{perm}, args.front()); return prog.add_instruction(migraphx::op::transpose{perm}, args.front());
} }
void parse_from(std::istream& is) void parse_from(std::istream& is)
...@@ -519,7 +519,7 @@ struct onnx_parser ...@@ -519,7 +519,7 @@ struct onnx_parser
{ {
if(node.name().empty()) if(node.name().empty())
{ {
std::string generated = "migraph_unnamed_node"; std::string generated = "migraphx_unnamed_node";
return std::accumulate(node.output().begin(), return std::accumulate(node.output().begin(),
node.output().end(), node.output().end(),
generated, generated,
...@@ -694,4 +694,4 @@ program parse_onnx(const std::string& name) ...@@ -694,4 +694,4 @@ program parse_onnx(const std::string& name)
} }
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#include <migraph/onnx.hpp> #include <migraphx/onnx.hpp>
#include <migraph/gpu/target.hpp> #include <migraphx/gpu/target.hpp>
#include <migraph/gpu/hip.hpp> #include <migraphx/gpu/hip.hpp>
#include <migraph/generate.hpp> #include <migraphx/generate.hpp>
#include <migraph/verify.hpp> #include <migraphx/verify.hpp>
migraph::program::parameter_map create_param_map(const migraph::program& p, bool gpu = true) migraphx::program::parameter_map create_param_map(const migraphx::program& p, bool gpu = true)
{ {
migraph::program::parameter_map m; migraphx::program::parameter_map m;
for(auto&& x : p.get_parameter_shapes()) for(auto&& x : p.get_parameter_shapes())
{ {
if(gpu) if(gpu)
m[x.first] = migraph::gpu::to_gpu(migraph::generate_argument(x.second)); m[x.first] = migraphx::gpu::to_gpu(migraphx::generate_argument(x.second));
else else
m[x.first] = migraph::generate_argument(x.second); m[x.first] = migraphx::generate_argument(x.second);
} }
return m; return m;
} }
...@@ -25,9 +25,9 @@ int main(int argc, char const* argv[]) ...@@ -25,9 +25,9 @@ int main(int argc, char const* argv[])
{ {
std::string file = argv[1]; std::string file = argv[1];
std::size_t n = argc > 2 ? std::stoul(argv[2]) : 50; std::size_t n = argc > 2 ? std::stoul(argv[2]) : 50;
auto p = migraph::parse_onnx(file); auto p = migraphx::parse_onnx(file);
std::cout << "Compiling ... " << std::endl; std::cout << "Compiling ... " << std::endl;
p.compile(migraph::gpu::target{}); p.compile(migraphx::gpu::target{});
std::cout << "Allocating params ... " << std::endl; std::cout << "Allocating params ... " << std::endl;
auto m = create_param_map(p); auto m = create_param_map(p);
std::cout << "Running performance report ... " << std::endl; std::cout << "Running performance report ... " << std::endl;
......
#include <migraph/onnx.hpp> #include <migraphx/onnx.hpp>
int main(int argc, char const* argv[]) int main(int argc, char const* argv[])
{ {
if(argc > 1) if(argc > 1)
{ {
std::string file = argv[1]; std::string file = argv[1];
auto prog = migraph::parse_onnx(file); auto prog = migraphx::parse_onnx(file);
std::cout << prog << std::endl; std::cout << prog << std::endl;
} }
} }
#include <migraph/onnx.hpp> #include <migraphx/onnx.hpp>
#include <migraph/cpu/target.hpp> #include <migraphx/cpu/target.hpp>
#include <migraph/gpu/target.hpp> #include <migraphx/gpu/target.hpp>
#include <migraph/gpu/hip.hpp> #include <migraphx/gpu/hip.hpp>
#include <migraph/generate.hpp> #include <migraphx/generate.hpp>
#include <migraph/verify_args.hpp> #include <migraphx/verify_args.hpp>
#include <migraph/instruction.hpp> #include <migraphx/instruction.hpp>
template <class T> template <class T>
auto get_hash(const T& x) auto get_hash(const T& x)
...@@ -15,14 +15,14 @@ auto get_hash(const T& x) ...@@ -15,14 +15,14 @@ auto get_hash(const T& x)
} }
template <class F> template <class F>
migraph::argument run_cpu(F f) migraphx::argument run_cpu(F f)
{ {
auto p = f(); auto p = f();
p.compile(migraph::cpu::target{}); p.compile(migraphx::cpu::target{});
migraph::program::parameter_map m; migraphx::program::parameter_map m;
for(auto&& x : p.get_parameter_shapes()) for(auto&& x : p.get_parameter_shapes())
{ {
m[x.first] = migraph::generate_argument(x.second, get_hash(x.first)); m[x.first] = migraphx::generate_argument(x.second, get_hash(x.first));
} }
auto out = p.eval(m); auto out = p.eval(m);
std::cout << p << std::endl; std::cout << p << std::endl;
...@@ -30,19 +30,19 @@ migraph::argument run_cpu(F f) ...@@ -30,19 +30,19 @@ migraph::argument run_cpu(F f)
} }
template <class F> template <class F>
migraph::argument run_gpu(F f) migraphx::argument run_gpu(F f)
{ {
auto p = f(); auto p = f();
p.compile(migraph::gpu::target{}); p.compile(migraphx::gpu::target{});
migraph::program::parameter_map m; migraphx::program::parameter_map m;
for(auto&& x : p.get_parameter_shapes()) for(auto&& x : p.get_parameter_shapes())
{ {
m[x.first] = migraph::gpu::to_gpu(migraph::generate_argument(x.second, get_hash(x.first))); m[x.first] = migraphx::gpu::to_gpu(migraphx::generate_argument(x.second, get_hash(x.first)));
} }
auto out = migraph::gpu::from_gpu(p.eval(m)); auto out = migraphx::gpu::from_gpu(p.eval(m));
std::cout << p << std::endl; std::cout << p << std::endl;
return migraph::gpu::from_gpu(out); return migraphx::gpu::from_gpu(out);
} }
template <class F> template <class F>
...@@ -50,12 +50,12 @@ void verify_program(const std::string& name, F f, double tolerance = 100) ...@@ -50,12 +50,12 @@ void verify_program(const std::string& name, F f, double tolerance = 100)
{ {
auto x = run_cpu(f); auto x = run_cpu(f);
auto y = run_gpu(f); auto y = run_gpu(f);
migraph::verify_args(name, x, y, tolerance); migraphx::verify_args(name, x, y, tolerance);
// std::cout << "cpu: " << x << std::endl; // std::cout << "cpu: " << x << std::endl;
// std::cout << "gpu: " << y << std::endl; // std::cout << "gpu: " << y << std::endl;
} }
void verify_instructions(const migraph::program& prog, double tolerance = 80) void verify_instructions(const migraphx::program& prog, double tolerance = 80)
{ {
for(auto&& ins : prog) for(auto&& ins : prog)
{ {
...@@ -68,8 +68,8 @@ void verify_instructions(const migraph::program& prog, double tolerance = 80) ...@@ -68,8 +68,8 @@ void verify_instructions(const migraph::program& prog, double tolerance = 80)
if(ins.name() == "reshape") if(ins.name() == "reshape")
continue; continue;
auto create_program = [&] { auto create_program = [&] {
migraph::program p; migraphx::program p;
std::vector<migraph::instruction_ref> inputs; std::vector<migraphx::instruction_ref> inputs;
for(auto&& arg : ins.inputs()) for(auto&& arg : ins.inputs())
{ {
if(arg->name() == "@literal") if(arg->name() == "@literal")
...@@ -100,7 +100,7 @@ void verify_reduced(F f, int n, double tolerance = 80) ...@@ -100,7 +100,7 @@ void verify_reduced(F f, int n, double tolerance = 80)
{ {
auto create_program = [&] { auto create_program = [&] {
migraph::program p = f(); migraphx::program p = f();
auto last = std::prev(p.end(), n + 1); auto last = std::prev(p.end(), n + 1);
p.remove_instructions(last, p.end()); p.remove_instructions(last, p.end());
return p; return p;
...@@ -113,7 +113,7 @@ void verify_reduced(F f, int n, double tolerance = 80) ...@@ -113,7 +113,7 @@ void verify_reduced(F f, int n, double tolerance = 80)
template <class F> template <class F>
void verify_reduced_program(F f, double tolerance = 80) void verify_reduced_program(F f, double tolerance = 80)
{ {
migraph::program p = f(); migraphx::program p = f();
auto n = std::distance(p.begin(), p.end()); auto n = std::distance(p.begin(), p.end());
for(int i = 0; i < n; i++) for(int i = 0; i < n; i++)
{ {
...@@ -127,7 +127,7 @@ int main(int argc, char const* argv[]) ...@@ -127,7 +127,7 @@ int main(int argc, char const* argv[])
if(not args.empty()) if(not args.empty())
{ {
std::string file = args.front(); std::string file = args.front();
auto p = migraph::parse_onnx(file); auto p = migraphx::parse_onnx(file);
std::cout << p << std::endl; std::cout << p << std::endl;
if(std::any_of(args.begin(), args.end(), [](const auto& s) { return s == "-i"; })) if(std::any_of(args.begin(), args.end(), [](const auto& s) { return s == "-i"; }))
...@@ -136,11 +136,11 @@ int main(int argc, char const* argv[]) ...@@ -136,11 +136,11 @@ int main(int argc, char const* argv[])
} }
else if(std::any_of(args.begin(), args.end(), [](const auto& s) { return s == "-r"; })) else if(std::any_of(args.begin(), args.end(), [](const auto& s) { return s == "-r"; }))
{ {
verify_reduced_program([&] { return migraph::parse_onnx(file); }); verify_reduced_program([&] { return migraphx::parse_onnx(file); });
} }
else else
{ {
verify_program(file, [&] { return migraph::parse_onnx(file); }); verify_program(file, [&] { return migraphx::parse_onnx(file); });
} }
} }
} }
#ifndef MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP #ifndef MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP
#define MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP #define MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP
#include <migraph/program.hpp> #include <migraphx/program.hpp>
#include <migraph/stringutils.hpp> #include <migraphx/stringutils.hpp>
#include <migraph/instruction.hpp> #include <migraphx/instruction.hpp>
#include <migraph/operators.hpp> #include <migraphx/operators.hpp>
#include <migraph/iterator_for.hpp> #include <migraphx/iterator_for.hpp>
#include <migraph/pass_config.hpp> #include <migraphx/pass_config.hpp>
#include <migraph/config.hpp> #include <migraphx/config.hpp>
#include <set> #include <set>
#include <list> #include <list>
#include <vector> #include <vector>
#include <queue> #include <queue>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
//#define MIGRAPH_DEBUG_OPT //#define MIGRAPH_DEBUG_OPT
...@@ -25,6 +25,6 @@ inline namespace MIGRAPH_INLINE_NS { ...@@ -25,6 +25,6 @@ inline namespace MIGRAPH_INLINE_NS {
#endif // MIGRAPH_DEBUG_OPT #endif // MIGRAPH_DEBUG_OPT
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#endif // MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP #endif // MIGRAPH_GUARD_RTGLIB_COMMON_HEADER_HPP
#include <migraph/memory_coloring.hpp> #include <migraphx/memory_coloring.hpp>
#include "memory_coloring_impl.hpp" #include "memory_coloring_impl.hpp"
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
void memory_coloring::apply(program& p) const void memory_coloring::apply(program& p) const
...@@ -14,4 +14,4 @@ void memory_coloring::apply(program& p) const ...@@ -14,4 +14,4 @@ void memory_coloring::apply(program& p) const
} }
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#include "memory_coloring_impl.hpp" #include "memory_coloring_impl.hpp"
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
void memory_coloring_impl::run() void memory_coloring_impl::run()
...@@ -335,4 +335,4 @@ void live_interval::dump() ...@@ -335,4 +335,4 @@ void live_interval::dump()
#endif #endif
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#ifndef MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP #ifndef MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#define MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP #define MIGRAPH_GUARD_RTGLIB_MEMORY_COLORING_IMPL_HPP
#include "common_header.hpp" #include "common_header.hpp"
#include <migraph/config.hpp> #include <migraphx/config.hpp>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
static const int invalid_offset = -1; static const int invalid_offset = -1;
...@@ -155,5 +155,5 @@ struct memory_coloring_impl ...@@ -155,5 +155,5 @@ struct memory_coloring_impl
}; };
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#endif #endif
#include <migraph/program.hpp> #include <migraphx/program.hpp>
#include <migraph/stringutils.hpp> #include <migraphx/stringutils.hpp>
#include <migraph/instruction.hpp> #include <migraphx/instruction.hpp>
#include <migraph/env.hpp> #include <migraphx/env.hpp>
#include <migraph/ranges.hpp> #include <migraphx/ranges.hpp>
#include <migraph/time.hpp> #include <migraphx/time.hpp>
#include <migraph/iterator_for.hpp> #include <migraphx/iterator_for.hpp>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_TRACE_COMPILE) MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_TRACE_COMPILE)
...@@ -502,4 +502,4 @@ std::ostream& operator<<(std::ostream& os, const program& p) ...@@ -502,4 +502,4 @@ std::ostream& operator<<(std::ostream& os, const program& p)
} }
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#include <migraph/shape.hpp> #include <migraphx/shape.hpp>
#include <migraph/stringutils.hpp> #include <migraphx/stringutils.hpp>
#include <numeric> #include <numeric>
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <iostream> #include <iostream>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
struct shape_impl struct shape_impl
...@@ -192,4 +192,4 @@ std::ostream& operator<<(std::ostream& os, const shape& x) ...@@ -192,4 +192,4 @@ std::ostream& operator<<(std::ostream& os, const shape& x)
} }
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#include <migraph/simplify_algebra.hpp> #include <migraphx/simplify_algebra.hpp>
#include <migraph/program.hpp> #include <migraphx/program.hpp>
#include <migraph/operators.hpp> #include <migraphx/operators.hpp>
#include <migraph/matcher.hpp> #include <migraphx/matcher.hpp>
#include <migraph/literal.hpp> #include <migraphx/literal.hpp>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
struct find_add_lit_broadcast struct find_add_lit_broadcast
...@@ -62,4 +62,4 @@ struct find_add_lit_broadcast ...@@ -62,4 +62,4 @@ 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_INLINE_NS
} // namespace migraph } // namespace migraphx
#include <migraph/simplify_reshapes.hpp> #include <migraphx/simplify_reshapes.hpp>
#include <migraph/program.hpp> #include <migraphx/program.hpp>
#include <migraph/instruction.hpp> #include <migraphx/instruction.hpp>
#include <migraph/operators.hpp> #include <migraphx/operators.hpp>
#include <migraph/iterator_for.hpp> #include <migraphx/iterator_for.hpp>
#include <migraph/ranges.hpp> #include <migraphx/ranges.hpp>
#include <unordered_set> #include <unordered_set>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
bool is_reshaper(const std::string& name) bool is_reshaper(const std::string& name)
...@@ -61,4 +61,4 @@ void simplify_reshapes::apply(program& p) const ...@@ -61,4 +61,4 @@ void simplify_reshapes::apply(program& p) const
} }
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
add_library(migraph_cpu add_library(migraphx_cpu
target.cpp target.cpp
lowering.cpp lowering.cpp
gemm.cpp gemm.cpp
) )
set_target_properties(migraph_cpu PROPERTIES EXPORT_NAME cpu) set_target_properties(migraphx_cpu PROPERTIES EXPORT_NAME cpu)
find_path(BLAZE_INCLUDE blaze/Blaze.h) find_path(BLAZE_INCLUDE blaze/Blaze.h)
find_package(Threads) find_package(Threads)
rocm_clang_tidy_check(migraph_cpu) rocm_clang_tidy_check(migraphx_cpu)
target_link_libraries(migraph_cpu migraph Threads::Threads) target_link_libraries(migraphx_cpu migraphx Threads::Threads)
target_include_directories(migraph_cpu PRIVATE ${BLAZE_INCLUDE}) target_include_directories(migraphx_cpu PRIVATE ${BLAZE_INCLUDE})
target_compile_definitions(migraph_cpu PRIVATE -DBLAZE_USE_CPP_THREADS) target_compile_definitions(migraphx_cpu PRIVATE -DBLAZE_USE_CPP_THREADS)
rocm_install_targets( rocm_install_targets(
TARGETS migraph_cpu TARGETS migraphx_cpu
INCLUDE INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
) )
......
#include <migraph/cpu/gemm.hpp> #include <migraphx/cpu/gemm.hpp>
#include <migraph/dfor.hpp> #include <migraphx/dfor.hpp>
#include <migraph/requires.hpp> #include <migraphx/requires.hpp>
#include <blaze/math/CustomMatrix.h> #include <blaze/math/CustomMatrix.h>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
namespace cpu { namespace cpu {
...@@ -95,4 +95,4 @@ void migemm( ...@@ -95,4 +95,4 @@ void migemm(
} // namespace cpu } // namespace cpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#ifndef MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP #ifndef MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP #define MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#include <migraph/config.hpp> #include <migraphx/config.hpp>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
namespace cpu { namespace cpu {
...@@ -14,6 +14,6 @@ struct context ...@@ -14,6 +14,6 @@ struct context
} // namespace cpu } // namespace cpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_CPU_GEMM_HPP #ifndef MIGRAPH_GUARD_RTGLIB_CPU_GEMM_HPP
#define MIGRAPH_GUARD_RTGLIB_CPU_GEMM_HPP #define MIGRAPH_GUARD_RTGLIB_CPU_GEMM_HPP
#include <migraph/argument.hpp> #include <migraphx/argument.hpp>
#include <migraph/config.hpp> #include <migraphx/config.hpp>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
namespace cpu { namespace cpu {
...@@ -13,6 +13,6 @@ void migemm( ...@@ -13,6 +13,6 @@ void migemm(
} // namespace cpu } // namespace cpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_CPU_LOWERING_HPP #ifndef MIGRAPH_GUARD_RTGLIB_CPU_LOWERING_HPP
#define MIGRAPH_GUARD_RTGLIB_CPU_LOWERING_HPP #define MIGRAPH_GUARD_RTGLIB_CPU_LOWERING_HPP
#include <migraph/program.hpp> #include <migraphx/program.hpp>
#include <migraph/config.hpp> #include <migraphx/config.hpp>
namespace migraph { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPH_INLINE_NS {
namespace cpu { namespace cpu {
...@@ -16,6 +16,6 @@ struct lowering ...@@ -16,6 +16,6 @@ struct lowering
} // namespace cpu } // namespace cpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraphx
#endif #endif
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