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

[metal] Support device memory allocation/deallocation #4439

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Mar 3, 2022

Related issue = #2736

@netlify
Copy link

netlify bot commented Mar 3, 2022

✔️ Deploy Preview for docsite-preview canceled.

🔨 Explore the source changes: ddd608b

🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/62259c47b9466a0007b61d0f

@k-ye k-ye marked this pull request as ready for review March 3, 2022 08:06
@k-ye k-ye changed the title [metal] Support memory allocation/deallocation [metal] Support device memory allocation/deallocation Mar 3, 2022
Copy link
Collaborator

@qiao-bo qiao-bo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

res.device = this;
res.alloc_id = allocations_.size();

auto &ialloc = allocations_[res.alloc_id]; // "i" for internal
Copy link
Contributor

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? ;)

Copy link
Member Author

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 ?

@k-ye k-ye merged commit 98553ca into taichi-dev:master Mar 8, 2022
@k-ye k-ye deleted the mtl-dev-mem branch March 8, 2022 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants