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

cudax::*_memory_resource should be an object not a type #4095

Open
brycelelbach opened this issue Mar 11, 2025 · 1 comment
Open

cudax::*_memory_resource should be an object not a type #4095

brycelelbach opened this issue Mar 11, 2025 · 1 comment

Comments

@brycelelbach
Copy link
Contributor

cudax::*_memory_resource should be a constexpr/constinst global object, not a type. I want to write foo(cudax::device_memory_resource) not foo(cudax::device_memory_resource{}). This is the common case, so we should optimize for it; if you need flags, you use the type name (which could be cudax::*_memory_resource_type, cudax::*_memory_resource_t, or something like that).

In Thrust, I believe we made these objects not types.

@miscco
Copy link
Contributor

miscco commented Mar 11, 2025

We considered adding global objects for those types, but decided against that because that has much stronger implications on stability of a type. Changing anything in the default object might break user code in an unclear and hard to debug way, which is why we opted out of providing global objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants