You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is execution space a required property on a buffer type? We should be able to infer this from the memory resource provided. I fear we've created a design that is too complicated.
I want to be able to do this:
auto ax = cuda::buffer<float>(cuda::device_memory_resource, 100, cuda::uninit);
auto y = cuda::async_buffer<float>(my_stream, cuda::device_memory_resource, 100, cuda::uninit);
(I know this can't work today because we don't have partial CTAD, but this is aspirational)
This is a fundamental interface everyone will have to use frequently. It should not be more complicated than this. I shouldn't need to create an environment or deal with properties in the simple case, which is "I want a typed buffer of device memory that is not initialized".
Given we have no partial CTAD, we should create make_* helper functions for this.
auto ax = cuda::make_buffer<float>(cuda::device_memory_resource, 100, cuda::uninit);
auto y = cuda::make_async_buffer<float>(my_stream, cuda::device_memory_resource, 100, cuda::uninit);
The text was updated successfully, but these errors were encountered:
The root of the issue is that properties are an open set.
The way we designed them is that they are not part of the type signature. That means that the compiler does not know which properties to choose, because it would need to query all possible properties.
Also we do want to use any_resource and any_resource_ref as the vocabulary types, which are type erased wrappers around memory resources. However, any subset of the properties is also valid, so the compiler cannot determine the "right" one.
Finally, a lot of the designs go towards more explicit APIs that are less error prone, which often requires the user to properly state their intend
Why is execution space a required property on a buffer type? We should be able to infer this from the memory resource provided. I fear we've created a design that is too complicated.
I want to be able to do this:
(I know this can't work today because we don't have partial CTAD, but this is aspirational)
This is a fundamental interface everyone will have to use frequently. It should not be more complicated than this. I shouldn't need to create an environment or deal with properties in the simple case, which is "I want a typed buffer of device memory that is not initialized".
Given we have no partial CTAD, we should create
make_*
helper functions for this.The text was updated successfully, but these errors were encountered: