-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[metal] Plug in the SNodeRep structs into codegen #1480
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1480 +/- ##
==========================================
+ Coverage 66.17% 67.38% +1.20%
==========================================
Files 38 38
Lines 5405 5593 +188
Branches 976 976
==========================================
+ Hits 3577 3769 +192
+ Misses 1660 1658 -2
+ Partials 168 166 -2
Continue to review full report at Codecov.
|
e251736
to
8aa6c04
Compare
6c1138d
to
542e341
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
This is mostly a refactoring of the SNode structs implementation on Metal, with no functional changes.
I added a
SNodeRep_*
for each snode type supported on Metal. It is very similar to thenode_*
files in https://github.com/taichi-dev/taichi/tree/master/taichi/runtime/llvm. Each generated SNode structs will own anrep_
object. TheseSNodeRep_*
provides the interfaces for operations like checking activation, activating/deactivating and getting a child.Advantages:
SNodeRep
s make it much easier to implementlistgen
andstruct-for
kernels fo checking activation.SNodeOpStmt
, before this PR, we had to manually figure out the memory address of the specific cell, then call the global helper function. Now that these functions are implemented inside eachrep
, we can just call the corresponding interface on the generated SNode structs themselves.The constructor of a generated SNode takes in, in addition to its memory address,
Runtime
andMemoryAllocator
now. These aren't used for now, but will be forpointer
SNodes.Here's an example:
Related issue = #1174
[Click here for the format server]