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

How to deal with a vector of cu:: objects? #167

Open
csbnw opened this issue Jul 5, 2022 · 0 comments
Open

How to deal with a vector of cu:: objects? #167

csbnw opened this issue Jul 5, 2022 · 0 comments

Comments

@csbnw
Copy link
Contributor

csbnw commented Jul 5, 2022

Currently, writing something like std::vector<cu::DeviceMemory> v(2); is not supported since there is no default constructor for cu::DeviceMemory. I am now working around this by declaring std::vector<cu::DeviceMemory> v and filling the vector by repeatedly calling v.emplace_back(<size>).

This works fine for my current use case, but maybe there are other cases where it is more convenient to allocate a number of cu::DeviceMemory objects with the same size in one go.

The same applies to other cu:: classes, like cu::HostMemory.

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

No branches or pull requests

2 participants