24 #include "cheetah/utils/test/AlgoModuleTest.h" 25 #include "cheetah/utils/AlgoModule.h" 26 #include "panda/test/TestHandler.h" 27 #include "panda/test/TestPoolManager.h" 28 #include "panda/test/TestArch.h" 39 AlgoModuleTest::AlgoModuleTest()
44 void AlgoModuleTest::SetUp()
48 void AlgoModuleTest::TearDown()
54 template<
typename Algo>
57 _called[std::type_index(
typeid(Algo))] =
true;
62 bool active()
const {
return true; }
65 bool called()
const {
return _called.find(std::type_index(
typeid(Algo))) != _called.end(); }
68 mutable std::map<std::type_index, bool> _called;
71 template<
typename Arch>
72 class TestAlgo :
public panda::test::TestHandler
74 typedef panda::test::TestHandler BaseT;
82 typedef Arch Architecture;
83 template<
typename...Ts>
84 void operator()(Ts&&...) {
85 this->BaseT::operator()();
91 typedef panda::test::TestHandler BaseT;
101 template<
typename... Archs>
105 typedef panda::test::TestPoolManager<Archs...> PoolType;
106 typedef std::tuple<TestAlgo<Archs>...> Algos;
110 template<
typename... Archs>
113 typedef std::tuple<int> Signatures;
118 template<
typename... Archs>
121 typedef std::tuple<panda::SubmitMethod<TestA>,
int> Signatures;
128 panda::test::TestPoolManager<ArchA> pool;
130 pool.add_resource<
ArchA>();
134 auto job = mod(data);
136 handler.wait(std::chrono::seconds(5));
140 TEST_F(
AlgoModuleTest, test_basic_operation_single_algo_multiple_signatures)
143 panda::test::TestPoolManager<ArchA> pool;
145 pool.add_resource<
ArchA>();
149 auto job = mod(data);
151 handler.wait(std::chrono::seconds(5));
156 handler.wait(std::chrono::seconds(5));
162 panda::test::TestPoolManager<ArchA, ArchB> pool;
164 pool.add_resource<
ArchA>();
165 pool.add_resource<
ArchB>();
169 auto job = mod(data);
171 handler.wait(std::chrono::seconds(5));
Provides a module of multiple algorimic implementations to perform a specific task.
Some limits and constants for FLDO.