Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/AssociativeOpsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "IRPrinter.h"

#include <mutex>
#include <tuple>

namespace Halide {
namespace Internal {
Expand Down Expand Up @@ -93,17 +94,8 @@ struct TableKey {
return (types == other.types) && (root == other.root) && (dim == other.dim);
}
bool operator<(const TableKey &other) const {
if (types < other.types) {
return true;
} else if (types > other.types) {
return false;
}
if (root < other.root) {
return true;
} else if (root > other.root) {
return false;
}
return (dim < other.dim);
return std::tie(types, root, dim) <
std::tie(other.types, other.root, other.dim);
}
};

Expand Down
17 changes: 4 additions & 13 deletions src/Schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <map>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -552,19 +553,9 @@ struct FusedPair {
(var_name == other.var_name);
}
bool operator<(const FusedPair &other) const {
if (func_1 != other.func_1) {
return func_1 < other.func_1;
}
if (func_2 != other.func_2) {
return func_2 < other.func_2;
}
if (var_name != other.var_name) {
return var_name < other.var_name;
}
if (stage_1 != other.stage_1) {
return stage_1 < other.stage_1;
}
return stage_2 < other.stage_2;
return std::tie(func_1, func_2, var_name, stage_1, stage_2) <
std::tie(other.func_1, other.func_2, other.var_name,
other.stage_1, other.stage_2);
}
};

Expand Down
32 changes: 9 additions & 23 deletions src/StageStridedLoads.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "StageStridedLoads.h"
#include <tuple>

#include "CSE.h"
#include "ExprUsesVar.h"
#include "IREquality.h"
Expand All @@ -7,6 +8,7 @@
#include "IRVisitor.h"
#include "Scope.h"
#include "Simplify.h"
#include "StageStridedLoads.h"
#include "Substitute.h"

namespace Halide {
Expand Down Expand Up @@ -39,31 +41,15 @@ class FindStridedLoads : public IRVisitor {

bool operator<(const Key &other) const {
// Check fields in order of cost to compare
if (stride < other.stride) {
return true;
} else if (stride > other.stride) {
return false;
} else if (lanes < other.lanes) {
return true;
} else if (lanes > other.lanes) {
return false;
} else if (scope < other.scope) {
return true;
} else if (scope > other.scope) {
return false;
} else if (allocation < other.allocation) {
return true;
} else if (allocation > other.allocation) {
return false;
} else if (type < other.type) {
return true;
} else if (other.type < type) {
return false;
} else if (buf < other.buf) {
auto lhs = std::tie(stride, lanes, scope, allocation, type, buf);
auto rhs = std::tie(other.stride, other.lanes, other.scope,
other.allocation, other.type, other.buf);
if (lhs < rhs) {
return true;
} else if (buf > other.buf) {
} else if (rhs < lhs) {
return false;
} else {
// base compares by graph equivalence, so it can't go in the tuple.
return graph_less_than(base, other.base);
}
}
Expand Down
19 changes: 3 additions & 16 deletions src/autoschedulers/mullapudi2016/AutoSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <map>
#include <regex>
#include <set>
#include <tuple>
#include <utility>

namespace Halide {
Expand Down Expand Up @@ -203,22 +204,8 @@ struct DependenceAnalysis {
(only_regions_computed == other.only_regions_computed);
}
bool operator<(const RegionsRequiredQuery &other) const {
if (f < other.f) {
return true;
} else if (f > other.f) {
return false;
}
if (stage < other.stage) {
return true;
} else if (stage > other.stage) {
return false;
}
if (only_regions_computed < other.only_regions_computed) {
return true;
} else if (only_regions_computed > other.only_regions_computed) {
return false;
}
return prods < other.prods;
return std::tie(f, stage, only_regions_computed, prods) <
std::tie(other.f, other.stage, other.only_regions_computed, other.prods);
}
};
struct RegionsRequired {
Expand Down
Loading