58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
#ifndef ALSK_CELERO_EXECUTOR_COMMON_H
|
|
#define ALSK_CELERO_EXECUTOR_COMMON_H
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
#include <celero/Celero.h>
|
|
|
|
#include <alsk/alsk.h>
|
|
|
|
#include "../bone/common.h"
|
|
|
|
namespace bench {
|
|
|
|
constexpr auto buildExprFarm() {
|
|
using namespace alsk::arg;
|
|
using namespace alsk::edsl;
|
|
return 20 * eTaskV<1000>;
|
|
}
|
|
|
|
constexpr auto exprFarm = buildExprFarm();
|
|
|
|
constexpr auto buildExprFarmSel() {
|
|
using namespace alsk::arg;
|
|
using namespace alsk::edsl;
|
|
return link<void(int, int)>(link<Data(P<0>, P<1>)>(eTask) & link<Data(R<0>)>((50 * link<Data(P<0>)>(eTaskD)) ->* eSelect));
|
|
}
|
|
|
|
constexpr auto exprFarmSel = buildExprFarmSel();
|
|
|
|
constexpr auto buildExprTwo() {
|
|
using namespace alsk::arg;
|
|
using namespace alsk::edsl;
|
|
|
|
constexpr auto farmsel = link<Data(R<0>)>(1000 * link<Data(P<0>)>(eTaskD)) ->* eSelect;
|
|
constexpr auto serial = link<R<1>(P<0>, P<1>)>(link<Data(P<0>, P<1>)>(eTask) & farmsel);
|
|
return link<void(int, int)>(2 * serial);
|
|
}
|
|
|
|
constexpr auto exprTwo = buildExprTwo();
|
|
|
|
constexpr auto buildExprTwoS() {
|
|
using namespace alsk::arg;
|
|
using namespace alsk::edsl;
|
|
|
|
constexpr auto farmsel = link<Data(Data const&)>(1000 * link<Data(P<0>)>(eTaskD)) ->* eSelect;
|
|
constexpr auto itersel = &link<Data(R<0>)>(2 * farmsel) ->* eSelect;
|
|
constexpr auto serial = link<R<1>(P<0>, P<1>)>(link<Data(P<0>, P<1>)>(eTask) & itersel);
|
|
constexpr auto loop = &link<void(P<0>, P<1>)>(2 * serial);
|
|
return link<void(int, int)>(2 * loop);
|
|
}
|
|
|
|
constexpr auto exprTwoS = buildExprTwoS();
|
|
|
|
}
|
|
|
|
#endif
|