00001
00025 #ifndef GALOIS_RUNTIME_ORDERED_WORK_H
00026 #define GALOIS_RUNTIME_ORDERED_WORK_H
00027
00028 #include "Galois/Runtime/DeterministicWork.h"
00029
00030
00031 namespace Galois {
00032 namespace Runtime {
00033
00034 template <typename NhFunc, typename OpFunc>
00035 struct OrderedTraits {
00036 static const bool NeedsPush = !Galois::does_not_need_push<OpFunc>::value;
00037 static const bool HasFixedNeighborhood = Galois::has_fixed_neighborhood<NhFunc>::value;
00038 };
00039
00040
00041 template <typename Iter, typename Cmp, typename NhFunc, typename OpFunc>
00042 void for_each_ordered_impl (Iter beg, Iter end, const Cmp& cmp, const NhFunc& nhFunc, const OpFunc& opFunc, const char* loopname) {
00043 #if 0
00044 if (!OrderedTraits<NhFunc, OpFunc>::NeedsPush && OrderedTraits<NhFunc, OpFunc>::HasFixedNeighborhood) {
00045
00046 GALOIS_DIE("Remove-only executor not implemented yet");
00047 } else if (OrderedTraits<NhFunc, OpFunc>::HasFixedNeighborhood) {
00048 for_each_ordered_lc (beg, end, cmp, nhFunc, opFunc, loopname);
00049 } else {
00050 for_each_ordered_2p (beg, end, cmp, nhFunc, opFunc, loopname);
00051 }
00052 #else
00053 GALOIS_DIE("not yet implemented");
00054 #endif
00055 }
00056
00057
00058 template <typename Iter, typename Cmp, typename NhFunc, typename OpFunc, typename StableTest>
00059 void for_each_ordered_impl (Iter beg, Iter end, const Cmp& cmp, const NhFunc& nhFunc, const OpFunc& opFunc, const StableTest& stabilityTest, const char* loopname) {
00060 #if 0
00061 if (!OrderedTraits<NhFunc, OpFunc>::NeedsPush && OrderedTraits<NhFunc, OpFunc>::HasFixedNeighborhood) {
00062 GALOIS_DIE("no-adds + fixed-neighborhood == stable-source");
00063 } else if (OrderedTraits<NhFunc, OpFunc>::HasFixedNeighborhood) {
00064 for_each_ordered_lc (beg, end, cmp, nhFunc, opFunc, stabilityTest, loopname);
00065 } else {
00066 GALOIS_DIE("two-phase executor for unstable-source algorithms not implemented yet");
00067
00068
00069 }
00070 #else
00071 GALOIS_DIE("not yet implemented");
00072 #endif
00073 }
00074
00075 }
00076 }
00077
00078 #endif // GALOIS_RUNTIME_ORDERED_WORK_H