-
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] Support device memory allocation/deallocation #4439
Conversation
✔️ Deploy Preview for docsite-preview canceled. 🔨 Explore the source changes: ddd608b 🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/62259c47b9466a0007b61d0f |
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.
LGTM
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.
LGTM!
taichi/backends/metal/device.cpp
Outdated
res.device = this; | ||
res.alloc_id = allocations_.size(); | ||
|
||
auto &ialloc = allocations_[res.alloc_id]; // "i" for internal |
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.
super nit: I personally prefer to explicitly spell out the type when it's short to help code readability :P But I'm definitely aware that people have different opinions. Maybe good to align on this internally in the future? ;)
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.
+1 on explicitly writing out the type. Maybe https://google.github.io/styleguide/cppguide.html#Type_deduction ?
Related issue = #2736