forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify definitions of PortableMultiCollection<TDev, ...>, and allow…
… it to be used outside of ALPAKA_ACCELERATOR_NAMESPACE I.e. repeat cms-sw#43310 on PortableMultiCollection.
- Loading branch information
Showing
6 changed files
with
47 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
DataFormats/Portable/test/test_catch2_portableMultiCollectionOnHost.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <catch.hpp> | ||
|
||
#include "DataFormats/Portable/interface/PortableCollection.h" | ||
#include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
#include "DataFormats/SoATemplate/interface/SoACommon.h" | ||
#include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
#include "DataFormats/SoATemplate/interface/SoAView.h" | ||
|
||
namespace { | ||
GENERATE_SOA_LAYOUT(TestLayout1, SOA_COLUMN(double, x), SOA_COLUMN(int32_t, id)) | ||
GENERATE_SOA_LAYOUT(TestLayout2, SOA_COLUMN(float, y), SOA_COLUMN(int32_t, z)) | ||
|
||
using TestSoA1 = TestLayout1<>; | ||
using TestSoA2 = TestLayout2<>; | ||
|
||
constexpr auto s_tag = "[PortableMultiCollection]"; | ||
} // namespace | ||
|
||
// This test is currently mostly about the code compiling | ||
TEST_CASE("Use of PortableMultiCollection<T, TDev> on host code", s_tag) { | ||
std::array<int, 2> const sizes{{10, 5}}; | ||
|
||
PortableMultiCollection<alpaka::DevCpu, TestSoA1, TestSoA2> coll(sizes, cms::alpakatools::host()); | ||
|
||
SECTION("Tests") { REQUIRE(coll.sizes() == sizes); } | ||
|
||
static_assert(std::is_same_v<PortableMultiCollection<alpaka::DevCpu, TestSoA1, TestSoA2>, | ||
PortableHostMultiCollection<TestSoA1, TestSoA2>>); | ||
} |
File renamed without changes.