summaryrefslogtreecommitdiff
path: root/modules/core/tests/flatten.cpp
blob: 3da05b50441f7cbea66b274c8c02f762152139af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <forstio/test/suite.hpp>

#include "../c++/flatten.hpp"

namespace {
namespace sch {
using namespace kel::lbm::sch;
}

SAW_TEST("Flatten Index Stride"){
	using namespace kel;

	constexpr kel::lbm::data<sch::UInt64> zero = lbm::flatten_index<sch::UInt64,3u>::stride<0u>({{2u,4u,3u}});
	constexpr kel::lbm::data<sch::UInt64> one  = lbm::flatten_index<sch::UInt64,3u>::stride<1u>({{2u,4u,3u}});
	constexpr kel::lbm::data<sch::UInt64> two  = lbm::flatten_index<sch::UInt64,3u>::stride<2u>({{2u,4u,3u}});

	SAW_EXPECT(zero.get() == 1u, "Zero is correct");
	SAW_EXPECT(one.get() == 2u, "Zero is correct");
	SAW_EXPECT(two.get() == 8u, "Zero is correct");
}

}