acts-project / algebra-plugins

Mozilla Public License 2.0
3 stars 10 forks source link

use std::array for array_s #20

Closed beomki-yeo closed 3 years ago

beomki-yeo commented 3 years ago

Currently array_s is an alias of vecmem::static_array when vecmem algebra is turned on. Unfortunately this doesn't work with detray because it cannot be called with constexpr: see here for example.

So let's roll it back to std::array

niermann999 commented 3 years ago

Hm, I don't see a particular reason why this has to be a vecmem array type. As long as it is not dynamically allocated and the masks are stored in vecmem containers we should be fine. I will have a look

beomki-yeo commented 3 years ago

@niermann999 I just looked into the possiblity of using vecmem::static_array for detray, and it turned out that there are huge things to be fixed to use this - constexpr are used in quite many places + it doesnt support the braced-enclosed initializer etc.

I suggest merging this PR first to avoid complexity, and fix vecmem::static_array in vecmem side later on to come back to what it was.

niermann999 commented 3 years ago

Yes, you are right. Lets put it in the detray: plugin/algebra/.../array_definitions.hpp for now, because that is easier to update between the projects. Or are there issues in traccc as well?

beomki-yeo commented 3 years ago

you mean plugins/algebra/include/detray/array/include/plugins/algebra/array_definitions.hpp?

how can it be done exactly? - you mean the following?

template <typename value_type, unsigned int kDIM>
using darray = std::array<value_type, kDIM>;

template <typename value_type>
using dvector = vecmem::vector<value_type>;
niermann999 commented 3 years ago

Yes, exactly. Because then we don't have to update the algebra-plugins submodule everywhere, right?

beomki-yeo commented 3 years ago

Right. I updated acts-project/detray#87 would you have a look?