Commit 10f4486c authored by Paul's avatar Paul
Browse files

Fix compilation errors

parent 9ef40f1c
...@@ -4,4 +4,4 @@ blaze,https://bitbucket.org/blaze-lib/blaze/get/f0755dea0e03.tar.gz -X header -D ...@@ -4,4 +4,4 @@ blaze,https://bitbucket.org/blaze-lib/blaze/get/f0755dea0e03.tar.gz -X header -D
half,https://github.com/pfultz2/half/archive/1.12.0.tar.gz -X header -H sha256:0a08660b68abb176ebc2a0cdf8de46e3182a7f46c66443bb80dbfaaec98cf969 half,https://github.com/pfultz2/half/archive/1.12.0.tar.gz -X header -H sha256:0a08660b68abb176ebc2a0cdf8de46e3182a7f46c66443bb80dbfaaec98cf969
pybind/pybind11@d159a563383d10c821ba7b2a71905d1207db6de4 --build pybind/pybind11@d159a563383d10c821ba7b2a71905d1207db6de4 --build
msgpack/msgpack-c@cpp-3.3.0 -DMSGPACK_BUILD_TESTS=Off msgpack/msgpack-c@cpp-3.3.0 -DMSGPACK_BUILD_TESTS=Off
# ROCmSoftwarePlatform/llvm-project-mlir,jungpark-mlir/llvm-project-mlir@495b72884ac5b7c42fbee48f558ed046e248233b -DBUILD_MIXR_TARGET=On # ROCmSoftwarePlatform/llvm-project-mlir@59905bc4e56b4d54dd416f00ecf08d1923bfb4e1 -DBUILD_MIXR_TARGET=On
...@@ -312,6 +312,7 @@ void move_standard_front(std::vector<instruction_ref>& args) ...@@ -312,6 +312,7 @@ void move_standard_front(std::vector<instruction_ref>& args)
auto gpu_name(const std::string& s) { return match::name("gpu::" + s); } auto gpu_name(const std::string& s) { return match::name("gpu::" + s); }
namespace {
struct find_layernorm struct find_layernorm
{ {
auto matcher() const { return match::layernorm(&gpu_name); } auto matcher() const { return match::layernorm(&gpu_name); }
...@@ -947,6 +948,7 @@ struct find_commutative_broadcast ...@@ -947,6 +948,7 @@ struct find_commutative_broadcast
p.replace_instruction(ins, ins->get_operator(), args); p.replace_instruction(ins, ins->get_operator(), args);
} }
}; };
}
void fuse_ops::apply(module& p) const void fuse_ops::apply(module& p) const
{ {
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <mlir-c/BuiltinAttributes.h> #include <mlir-c/BuiltinAttributes.h>
#include <mlir-c/BuiltinTypes.h> #include <mlir-c/BuiltinTypes.h>
#include <mlir-c/Diagnostics.h> #include <mlir-c/Diagnostics.h>
#include <mlir-c/Dialect/Standard.h>
#include <mlir-c/Dialect/MIGraphX.h> #include <mlir-c/Dialect/MIGraphX.h>
#include <mlir-c/IntegerSet.h> #include <mlir-c/IntegerSet.h>
#include <mlir-c/Pass.h> #include <mlir-c/Pass.h>
...@@ -396,7 +395,7 @@ struct mlir_program ...@@ -396,7 +395,7 @@ struct mlir_program
auto body_inputs = make_tensors(inputs); auto body_inputs = make_tensors(inputs);
mlir_region region = mlirRegionCreate(); mlir_region region = mlirRegionCreate();
mlir_block fbody = mlirBlockCreate(body_inputs.size(), body_inputs.data()); mlir_block fbody = mlirBlockCreate(body_inputs.size(), body_inputs.data(), &location);
MlirBlock result = fbody.get(); MlirBlock result = fbody.get();
mlirRegionAppendOwnedBlock(region.get(), fbody.release()); mlirRegionAppendOwnedBlock(region.get(), fbody.release());
...@@ -466,7 +465,7 @@ struct mlir_program ...@@ -466,7 +465,7 @@ struct mlir_program
std::string tname = get_device_name(); std::string tname = get_device_name();
// HACK: Since MLIR can't handle the full target name // HACK: Since MLIR can't handle the full target name
auto hacked_tname = tname.substr(0, tname.find(":")); auto hacked_tname = tname.substr(0, tname.find(":"));
mlirMIGraphXAddBackendPipeline(pm.get(), hacked_tname.c_str()); mlirMIGraphXAddBackendPipeline(pm.get(), hacked_tname.c_str(), nullptr, nullptr);
mlirPassManagerRun(pm.get(), mmodule.get()); mlirPassManagerRun(pm.get(), mmodule.get());
code_object_op op; code_object_op op;
...@@ -478,7 +477,7 @@ struct mlir_program ...@@ -478,7 +477,7 @@ struct mlir_program
std::pair<std::size_t, std::size_t> get_launch_params() std::pair<std::size_t, std::size_t> get_launch_params()
{ {
int attrs[2]; uint32_t attrs[2];
// returns block and grid sizes // returns block and grid sizes
mlirGetKernelAttrs(mmodule.get(), attrs); mlirGetKernelAttrs(mmodule.get(), attrs);
std::size_t local = attrs[0]; std::size_t local = attrs[0];
...@@ -488,8 +487,10 @@ struct mlir_program ...@@ -488,8 +487,10 @@ struct mlir_program
value::binary get_binary() value::binary get_binary()
{ {
value::binary result(mlirGetBinarySize(mmodule.get())); int size = 0;
if(mlirGetBinary(mmodule.get(), reinterpret_cast<char*>(result.data()))) mlirGetBinary(mmodule.get(), &size, nullptr);
value::binary result(size);
if(mlirGetBinary(mmodule.get(), &size, reinterpret_cast<char*>(result.data())))
return result; return result;
MIGRAPHX_THROW("Failed to compile mlir program"); MIGRAPHX_THROW("Failed to compile mlir program");
} }
......
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