alanmacd commented on code in PR #13752:
URL: https://github.com/apache/tvm/pull/13752#discussion_r1087304976
##########
src/target/source/codegen_c.cc:
##########
@@ -631,8 +632,11 @@ void CodeGenC::PrintVecBinaryOp(const std::string& op,
DataType t, PrimExpr lhs,
}
}
+unsigned int random_seed = 0;
void CodeGenC::VisitStmt_(const AllocateConstNode* op) {
- std::string symbol_name = op->buffer_var->name_hint;
+ // Add a random suffix to eliminate duplicate global variables.
+ int suffix = rand_r(&random_seed) % (2 << 24);
Review Comment:
any reason to not just use a counter and add that as suffix to each global
var name?
(this also breaks windows build as-is)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]