[python] fixed warnings for pybind11 and pytorch
This commit is contained in:
@@ -220,8 +220,6 @@ std::unique_ptr<driver::module> function::make_bin(ir::module &module, driver::c
|
||||
dce.run(module);
|
||||
vectorize.run(module);
|
||||
dce.run(module);
|
||||
|
||||
|
||||
// generate llvm code
|
||||
llvm::LLVMContext ctx;
|
||||
std::unique_ptr<llvm::Module> llvm(new llvm::Module(module.get_name(), ctx));
|
||||
|
@@ -493,7 +493,7 @@ extern std::map<size_t, std::shared_ptr<rt::function>> id_fn_map;
|
||||
|
||||
oss << std::endl;
|
||||
oss << std::endl;
|
||||
oss << "static auto registry = torch::jit::RegisterOperators(\"triton::" << name << "\", &" << name << ");" << std::endl;
|
||||
oss << "static auto registry = torch::RegisterOperators(\"triton::" << name << "\", &" << name << ");" << std::endl;
|
||||
|
||||
return {oss.str(), name};
|
||||
}
|
||||
|
@@ -65,12 +65,26 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
value = [hfunc = func_handle(std::move(func))](Args... args) -> Return {
|
||||
gil_scoped_acquire acq;
|
||||
object retval(hfunc.f(std::forward<Args>(args)...));
|
||||
/* Visual studio 2015 parser issue: need parentheses around this expression */
|
||||
return (retval.template cast<Return>());
|
||||
// value = [hfunc = func_handle(std::move(func))](Args... args) -> Return {
|
||||
// gil_scoped_acquire acq;
|
||||
// object retval(hfunc.f(std::forward<Args>(args)...));
|
||||
// /* Visual studio 2015 parser issue: need parentheses around this expression */
|
||||
// return (retval.template cast<Return>());
|
||||
// };
|
||||
|
||||
struct func_wrapper {
|
||||
func_handle hfunc;
|
||||
func_wrapper(func_handle&& hf): hfunc(std::move(hf)) {}
|
||||
Return operator()(Args... args) const {
|
||||
gil_scoped_acquire acq;
|
||||
object retval(hfunc.f(std::forward<Args>(args)...));
|
||||
/* Visual studio 2015 parser issue: need parentheses around this expression */
|
||||
return (retval.template cast<Return>());
|
||||
}
|
||||
};
|
||||
|
||||
value = func_wrapper(func_handle(std::move(func)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user