[go: nahoru, domu]

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

Implementing the operator! for nested boolean expressions #93

Closed
romeric opened this issue May 26, 2020 · 2 comments
Closed

Implementing the operator! for nested boolean expressions #93

romeric opened this issue May 26, 2020 · 2 comments
Labels

Comments

@romeric
Copy link
Owner
romeric commented May 26, 2020

!isfinite(Expression) does not compile. This is becuase

Tensor<bool,....> res = !isfinite(Expression); 

is a nested expression that calls the eval function for ! and isfinite. The first call is to eval<bool> for ! and the second (nested) call is to eval<EVAL_TYPE> for isfinite.

Now EVAL_TYPE is a macro alias to scalar_type so we get eval<bool>(eval<EVAL_TYPE>). The return type of the inner function is SIMDVector<bool,simd_abi::fixed<4>> say for SSE float, but the return type of the outer function given that the type is bool is SIMDVector<bool,simd_abi::fixed<16>> (again under SSE). If Instead we use something like result_scalar_type = typename result_type::scalar_type we will resolve the evaluation at least as far as types are concerned but given that we use simd_abi::fixed the size of SIMDVectors will not be the same as the nested eval<EVAL_TYPE==bool> is now initialised with simd vector of different sizes (one for bool 16/32/64 and one for float 4/8/16 for SSE/AVX/AVX512).

We need proper mask types for these to be resolved.

@romeric romeric added the simd label May 26, 2020
@romeric romeric changed the title Implementing the operator! Implementing the operator! for nested expressions May 26, 2020
@romeric
Copy link
Owner Author
romeric commented May 26, 2020

Pertains to simd mask #54

@romeric romeric changed the title Implementing the operator! for nested expressions Implementing the operator! for nested boolean expressions May 27, 2020
@romeric
Copy link
Owner Author
romeric commented Jun 6, 2020

It seems like simply changing the return type of the eval types of boolean expression to bool fixes the issue. This is fixed in d90baa9 for now for unary and binary boolean expressions. When we have masks implemented they need to be changed back to U.

@romeric romeric closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant