Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:41

0001 #include <alpaka/alpaka.hpp>
0002 
0003 #define CATCH_CONFIG_MAIN
0004 #include <catch.hpp>
0005 
0006 #include "HeterogeneousCore/AlpakaInterface/interface/config.h"
0007 
0008 static constexpr auto s_tag = "[" ALPAKA_TYPE_ALIAS_NAME(alpakaTestVec) "]";
0009 
0010 TEST_CASE("Standard checks of " ALPAKA_TYPE_ALIAS_NAME(alpakaTestVec), s_tag) {
0011   SECTION("Vec1D") {
0012     alpaka_common::Vec1D s1 = 100;
0013     alpaka_common::Vec1D s2 = 42;
0014     alpaka_common::Vec1D si = 42;
0015     REQUIRE(alpaka::elementwise_min(s1, s2) == si);
0016   }
0017 
0018   SECTION("Vec3D") {
0019     alpaka_common::Vec3D v1{100, 10, 10};
0020     alpaka_common::Vec3D v2{42, 42, 1};
0021     alpaka_common::Vec3D vi{42, 10, 1};
0022     REQUIRE(alpaka::elementwise_min(v1, v2) == vi);
0023   }
0024 }