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

Feature request: pull_array and pull_vector #323

Closed
haesleinhuepf opened this issue Jul 12, 2024 · 1 comment · Fixed by #324
Closed

Feature request: pull_array and pull_vector #323

haesleinhuepf opened this issue Jul 12, 2024 · 1 comment · Fixed by #324

Comments

@haesleinhuepf
Copy link
Member

I wrote now multiple times this code:

int size ...;
std::vector<float> result(size);
gpu_result.read(result);

And I'm wondering if it could be put into a pull_vector function, which would make my life easier:

std::vector<float> result = cle::pull_vector(gpu_result);
@StRigaud
Copy link
Member

The pull_vector would need to be templated. Like I said in your PR, the output vector template type must match the gpu array type.

I did something like that if you look in the memory.hpp functions, but I stopped using them because it simply save 1 line of code and this type of function would better fit a user API which CLIc is not.

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

Successfully merging a pull request may close this issue.

2 participants