Skip to content

Commit 5b0aa30

Browse files
authored
DPL: reduce template instanciation (#6290)
1 parent 8f0bffa commit 5b0aa30

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Framework/Core/include/Framework/DispatchPolicy.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ struct DispatchPolicy {
4949
/// the action to be used for matched devices
5050
DispatchOp action = DispatchOp::AfterComputation;
5151
/// matcher on specific output to trigger sending
52-
TriggerMatcher triggerMatcher = [](Output const&) { return true; };
52+
TriggerMatcher triggerMatcher = defaultDispatchPolicy();
53+
54+
static TriggerMatcher defaultDispatchPolicy();
5355

5456
/// Helper to create the default configuration.
5557
static std::vector<DispatchPolicy> createDefaultPolicies();

Framework/Core/src/DispatchPolicy.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ std::vector<DispatchPolicy> DispatchPolicy::createDefaultPolicies()
2525
return {DispatchPolicy{"dispatch-all-after-computation", [](DeviceSpec const&) { return true; }, DispatchPolicy::DispatchOp::AfterComputation}};
2626
}
2727

28+
DispatchPolicy::TriggerMatcher DispatchPolicy::defaultDispatchPolicy()
29+
{
30+
return DispatchPolicy::TriggerMatcher{[](Output const&) -> bool { return true; }};
31+
}
32+
2833
std::ostream& operator<<(std::ostream& oss, DispatchPolicy::DispatchOp const& val)
2934
{
3035
switch (val) {

0 commit comments

Comments
 (0)