xtensor icon indicating copy to clipboard operation
xtensor copied to clipboard

Expression system requires evaluation in many contexts

Open spectre-ns opened this issue 3 years ago • 1 comments

I'm trying to figure out why the code snippet requires assignment to a concrete xarray or xt::eval called to compile. I should be able to make these all auto and do it lazily right?

image

Am I doing something wrong? Adding SIMD support requires me to add an extra eval when calculating angle: image

The snippet above doesn't compile with the following error: Error C2664 'xsimd::batch<T,xsimd::default_arch> xsimd::batch<T,xsimd::default_arch>::load_unaligned(const double *,const double *)': cannot convert argument 1 from 'const T *' to 'const T *' \xtensor\xiterator.hpp 560

Finally, I expect this to work but it doesn't: image

We the following error Error C2296 '%': illegal, left operand has type '_Ty' xtensor\xoperation.hpp 111

Any thoughts?

spectre-ns avatar Apr 17 '22 15:04 spectre-ns

As soon as you want to assign something to an expression, this expression has to hold memory, it cannot be an unevaluated builder.

Regarding the errors you have, can you provide the full stacktrace?

JohanMabille avatar May 19 '22 09:05 JohanMabille