You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following #4561, in C++ codebase of Taichi, many counters are used to identify a instance. But the counters are global now, which causes some problems. Using Taichi AST string generated by irpass::print as offline-cache-key (#4401) cannot identify a kernel completely because of global counters. We need scoped-counters.
One kernel's ir/ast-string is related with calling order, because the id: Identifier which is member of IdExpression has auto incremental id: int (depending on static int variable id_counter). Global id_counter causes the problem.
I think we can remove this counters, and make them scoped.
Counters in C++ Side
(Simply using reg "static.*int.*counter" to search)
Identifier::id_counter, global scope and kernel/func scope
Following #4561, in C++ codebase of Taichi, many counters are used to identify a instance. But the counters are global now, which causes some problems. Using Taichi AST string generated by
irpass::print
as offline-cache-key (#4401) cannot identify a kernel completely because of global counters. We need scoped-counters.An example in which I found problem
1st:
f1(); f2()
, Ouput:2nd:
f2(); f1()
, Output:One kernel's ir/ast-string is related with calling order, because the
id
:Identifier
which is member ofIdExpression
has auto incrementalid
:int
(depending on static int variableid_counter
). Globalid_counter
causes the problem.I think we can remove this counters, and make them scoped.
Counters in C++ Side
(Simply using reg "static.*int.*counter" to search)
Identifier::id_counter
, global scope and kernel/func scopeSNode::counter
, program(global) scopeStmt::instance_id_counter
, kernel/func scopeTaskLaunchRecord::task_counter
, maybe kernel/func scopeThe text was updated successfully, but these errors were encountered: