Skip to content

Add pitched malloc and 2d memcpy to cust #64

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

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

kjetilkjeka
Copy link
Contributor

@kjetilkjeka kjetilkjeka commented Mar 17, 2022

Fixes #56

Add pitched malloc and 2d memcpy to cust::memory.

The memcpy_2d functions is working on elements in width/height instead of bytes. This does not correspond to what the other memcpy functions are currently doing but corresponds to what malloc (including malloc_pitched) is currently doing.

I see many good arguments for using bytes and many good arguments for using elements. The important thing is that the interface is consistent. My assumption is that it is more important with consistency between malloc and memcpy than between memcpys. Making the module completely consistent is outside the scope of this PR as discussed in #56

I also updated cust from 2018 edition to 2021 edition. This was mainly to get TryInto automatically into scope. I hope that was Ok.

@therishidesai
Copy link

Is there any path forward on getting this merged in?

@LegNeato
Copy link
Contributor

Hello! We are rebooting this project. Sorry for your PR not getting merged!

Is this still relevant?

@LegNeato
Copy link
Contributor

As these are just additions, we'll merge.

@LegNeato LegNeato merged commit 9c30bdf into Rust-GPU:master Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants