Skip to content

Commit

Permalink
SoA Proxy, main branch (2024.09.25.) (#296)
Browse files Browse the repository at this point in the history
* Introduced a concatenation constructor for vecmem::tuple.

Did not try to make a fully functional vecmem::tuple_cat
function, as that was not technically needed so far.

* Introduced vecmem::edm::proxy for host containers.

Proxies can be used to provide an "AoS view" over an
SoA container. A view that would make use of the same
interface that the container itself also uses.

Code for device container support was also added, but
is probably not functional at the moment.

* Added "proxy functionality" to vecmem::edm::device as well.

While also ensuring that vecmem::edm::proxy would be usable in
device code, and also with C++14.

* Tweaked the new code and its documentation a little.

* Switched to references with the const proxies.

As feared, this premature/misguided optimization was not helping
with code performance in real life.
  • Loading branch information
krasznaa authored Sep 30, 2024
1 parent 6e70975 commit b247389
Show file tree
Hide file tree
Showing 17 changed files with 1,163 additions and 122 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ if( VECMEM_BUILD_DOCS )
"${CMAKE_CURRENT_SOURCE_DIR}/cuda/include"
"${CMAKE_CURRENT_SOURCE_DIR}/hip/include"
"${CMAKE_CURRENT_SOURCE_DIR}/sycl/include" )
set( DOXYGEN_PREDEFINED
"__cplusplus=201700L" )
set( DOXYGEN_EXCLUDE
"${CMAKE_CURRENT_SOURCE_DIR}/tests"
"${CMAKE_CURRENT_SOURCE_DIR}/benchmarks"
Expand Down
4 changes: 2 additions & 2 deletions core/include/vecmem/containers/device_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace vecmem {

// Forward declaration(s).
namespace edm {
template <typename T>
template <typename T, template <typename> class I>
class device;
}

Expand All @@ -36,7 +36,7 @@ template <typename TYPE>
class device_vector {

// Make @c vecmem::edm::device a friend of this class.
template <typename T>
template <typename T, template <typename> class I>
friend class edm::device;

public:
Expand Down
9 changes: 5 additions & 4 deletions core/include/vecmem/edm/container.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* VecMem project, part of the ACTS project (R&D line)
*
* (c) 2023 CERN for the benefit of the ACTS project
* (c) 2023-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -40,7 +40,7 @@ struct container {

#if __cplusplus >= 201700L
/// Host container type
using host = interface_type<vecmem::edm::host<schema_type> >;
using host = interface_type<vecmem::edm::host<schema_type, interface_type>>;

/// (Non-const) Data type
using data = vecmem::edm::data<schema_type>;
Expand All @@ -52,10 +52,11 @@ struct container {
#endif // __cplusplus >= 201700L

/// (Non-const) Device container type
using device = interface_type<vecmem::edm::device<schema_type> >;
using device =
interface_type<vecmem::edm::device<schema_type, interface_type>>;
/// (Const) Device container type
using const_device =
interface_type<vecmem::edm::device<const_schema_type> >;
interface_type<vecmem::edm::device<const_schema_type, interface_type>>;

/// (Non-const) View type
using view = vecmem::edm::view<schema_type>;
Expand Down
Loading

0 comments on commit b247389

Please sign in to comment.