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

hydra::fill_random fails to compile with declared arguments #105

Closed
adicanto opened this issue Oct 23, 2020 · 7 comments
Closed

hydra::fill_random fails to compile with declared arguments #105

adicanto opened this issue Oct 23, 2020 · 7 comments
Assignees

Comments

@adicanto
Copy link

adicanto commented Oct 23, 2020

The following code doesn't compile because "The container is not iterable, or it is not convertible from/to the functor return value". Changing X with double in the container definition fixes the compilation, which hints to an issue with the conversion/understanding of the declared argument.

declarg(X, double)
using namespace hydra::arguments;
...
hydra::device::vector<X> data(n);
hydra::fill_random(data, hydra::UniformShape<X>(0.,1.) );
...
@dbrundu
Copy link
Contributor

dbrundu commented Oct 23, 2020

I'm observing the same error. In addition, putting the container in the host and using X type, fixes the compilation, so could be related to device reference conversions.

@AAAlvesJr
Copy link
Contributor

AAAlvesJr commented Oct 23, 2020

Thanks for the opening the issue. @dbrundu what does host and device mean in your case? are you running in gpu?

@dbrundu
Copy link
Contributor

dbrundu commented Oct 23, 2020

No, I'm running in CPU. For example with TBB using the host vector compiles while device vector does not.

@AAAlvesJr
Copy link
Contributor

Ok, I reproduce the bug. Starting to investigate...

AAAlvesJr added a commit that referenced this issue Oct 23, 2020
@AAAlvesJr
Copy link
Contributor

just pushed fix, all works on my box. let me know if you still have issues.

@adicanto
Copy link
Author

It works now

@AAAlvesJr
Copy link
Contributor

Perfect, thanks. Closing now...

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

3 participants