Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minor] Fix Clang compilation warning in fuse_tir.cc and codegen_c_host.cc #16511

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/relax/transform/fuse_tir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ class FusedTIRConstructor : public ExprVisitor {
const tir::Var& param = output_params[i];
const tir::Buffer& buffer = func->buffer_map.at(param);

auto unify_name_hints = [this, &buffer, &param]() {
auto unify_name_hints = [this, &buffer]() {
String base_name = buffer->name;
String unique_name = base_name + "_intermediate";
size_t unique_id = 0;
Expand Down
4 changes: 4 additions & 0 deletions src/target/source/codegen_c_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ void CodeGenCHost::InitGlobalContext() {

void CodeGenCHost::DefineModuleName() { decl_stream << "void* " << module_name_ << " = NULL;\n"; }

void CodeGenCHost::AddFunction(const GlobalVar& gvar, const PrimFunc& func) {
return AddFunction(gvar, func, /*emit_fwd_func_decl=*/false);
}

void CodeGenCHost::AddFunction(const GlobalVar& gvar, const PrimFunc& func,
bool emit_fwd_func_decl) {
auto global_symbol = func->GetAttr<String>(tvm::attr::kGlobalSymbol);
Expand Down
3 changes: 2 additions & 1 deletion src/target/source/codegen_c_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class CodeGenCHost : public CodeGenC {
const std::unordered_set<std::string>& devices);

void InitGlobalContext();
void AddFunction(const GlobalVar& gvar, const PrimFunc& f, bool emit_fwd_func_decl = false);
void AddFunction(const GlobalVar& gvar, const PrimFunc& f) override;
void AddFunction(const GlobalVar& gvar, const PrimFunc& f, bool emit_fwd_func_decl);
/*!
* \brief Add functions from the (unordered) range to the current module in a deterministic
* order. This helps with debugging.
Expand Down