-
Notifications
You must be signed in to change notification settings - Fork 99
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
Abs does == of views of type different types #252
Comments
I was first wondering how the heck this could drop through our testing framework. Turns out we run a unit test where BOTH the input and output for the function are of the same scalar type. I.e. we run something like View<complex<double>*> r("R",N);
View<complex<double>*> a("A",N);
abs(r,a); |
We can do a simple fix and use something like the following instead of the current comparison: if(std::is_same<X::array_layout,A::array_layout>::value &&
std::is_same<X::memory_space,A::memory_space>::value &&
( (void*) (x.data()) == (void*) (a.data()) ) &&
(x.extent(0) == a.extent(0)) ) |
@crtrott If the pointers are the same but the extents aren't, you're kind of in trouble :-D |
Actually you are right that extent comparison is probably intercepted somewhere else. |
Fix equivalent view check in KokkosBlas1_abs (issue #252)
In Trilinos' KokkosBlas1_abs_impl.hpp:228 V_Abs_generic checks for equivalence views of two different types with an == . This is no bueno.
trilinos/Trilinos#2894
The text was updated successfully, but these errors were encountered: