-
Notifications
You must be signed in to change notification settings - Fork 23
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
Optionally allow allocations to be zeroed #203
Comments
Here's a comment from @rchen20 in our internal issue:
And here's a follow-up from @ajkunen :
|
@brunner6, is this still something you are interested in, and if so, can you provide some motivation for why you want to do this? |
We have a pattern in our code where we do an allocation, and then need to remember to zero the array. We've had several bugs where we haven't remember that. Having a feature where the zeroing could happen on the device where it was allocated would have avoided that. (In contrast to std::vector, say, which even if you tricked the allocator out, you'd still zero initialize on the host and then transfer the memory to the GPU). Clearly this is pretty low priority for us, since we're not banging at your door... |
We would like to be able to specify that an allocation be zeroed upon allocation, sort of like
calloc
instead ofmalloc
, but with all the host/device and pool usage that Umpire and Chai provide. Since allocations can happen lazily, and on either the device or the host, (I think) Chai has the best information of where the allocation is happening when it happens so that the zeroing can happen most efficiently without extra memory transfers.@rchen20, @ajkunen, Verinder Rana, and John Loffeld also know the details. What other information is needed to flesh this request out?
The text was updated successfully, but these errors were encountered: