acts-project / algebra-plugins

Mozilla Public License 2.0
3 stars 10 forks source link

Public Header Tests, main branch (2023.03.29.) #100

Closed krasznaa closed 1 year ago

krasznaa commented 1 year ago

This is a sibling of https://github.com/acts-project/vecmem/pull/222.

I added a function called algebra_test_public_headers(...) that can be used to make sure that:

All this was necessitated because I noticed in traccc that some detray targets are not set up correctly. :frowning: But introducing rigorous tests revealed some problems already in vecmem, and now in this project as well. (The algebra::eigen_math, algebra::fastor_math, algebra::fastor_storage and algebra::vc_math targets have some problems currently.)

Note that here I just made sure that the CMake configuration would correctly reflect what the code is doing. But for instance I'm not convinced that algebra::vc_math is indeed meant to rely on algebra::cmath_math. :confused:

https://github.com/acts-project/algebra-plugins/blob/main/math/vc/include/algebra/math/impl/vc_transform3.hpp#L11

Could you check Beomki and Joana?

niermann999 commented 1 year ago

The Vc transform3 implementation relies on cmath::cross, it seems, not sure why it does not use vc::math::cross

krasznaa commented 1 year ago

The Vc transform3 implementation relies on cmath::cross, it seems, not sure why it does not use vc::math::cross

It's because of:

[ 86%] Building CXX object tests/CMakeFiles/algebra_test_vc.dir/vc/vc_vc.cpp.o
In file included from /home/krasznaa/ATLAS/projects/algebra-plugins/algebra-plugins/tests/vc/vc_vc.cpp:12:
/home/krasznaa/ATLAS/projects/algebra-plugins/algebra-plugins/tests/common/test_host_basics.hpp:132:36: error: no matching function for call to 'cross'
  typename TypeParam::vector3 vG = algebra::vector::cross(vD, vF);
                                   ^~~~~~~~~~~~~~~~~~~~~~
...
/home/krasznaa/ATLAS/projects/algebra-plugins/algebra-plugins/math/vc/include/algebra/math/impl/vc_vector.hpp:66:33: note: candidate template ignored: substitution failure [with vector_type1 = typename TypeParam::vector3, vector_type2 = typename TypeParam::matrix<3, 1>]: invalid operands to binary expression ('value_type' (aka 'float') and 'value_type' (aka 'Vc_1::array<float, 3>'))
ALGEBRA_HOST_DEVICE inline auto cross(const vector_type1 &a,
                                ^
...

But I'd like to leave that can of worms to a separate PR...

beomki-yeo commented 1 year ago

The Vc transform3 implementation relies on cmath::cross, it seems, not sure why it does not use vc::math::cross

I think that's what I did. Somehow I could not make some vc functions work with vc_transform3 so used some cmath functions. This should be fixed indeed