From 62b24fd6cb012d863ac68618407db9b3cac3374b Mon Sep 17 00:00:00 2001 From: Sean Treichler Date: Sat, 22 Dec 2018 08:55:52 -0800 Subject: [PATCH] realm: clean up deppart instantiation stuff --- runtime/realm/deppart/preimage.cc | 1 - runtime/realm/deppart/setops.cc | 3 -- runtime/realm/deppart/sparsity_impl.cc | 65 +------------------------- 3 files changed, 2 insertions(+), 67 deletions(-) diff --git a/runtime/realm/deppart/preimage.cc b/runtime/realm/deppart/preimage.cc index df18ddf1c1..56b9fefbae 100644 --- a/runtime/realm/deppart/preimage.cc +++ b/runtime/realm/deppart/preimage.cc @@ -56,7 +56,6 @@ namespace Realm { template template - __attribute__ ((noinline)) Event IndexSpace::create_subspaces_by_preimage(const std::vector,Rect > >& field_data, const std::vector >& targets, std::vector >& preimages, diff --git a/runtime/realm/deppart/setops.cc b/runtime/realm/deppart/setops.cc index 30570f705c..c8ec483728 100644 --- a/runtime/realm/deppart/setops.cc +++ b/runtime/realm/deppart/setops.cc @@ -148,7 +148,6 @@ namespace Realm { template - __attribute__ ((noinline)) /*static*/ Event IndexSpace::compute_unions(const std::vector >& lhss, const std::vector >& rhss, std::vector >& results, @@ -229,7 +228,6 @@ namespace Realm { } template - __attribute__ ((noinline)) /*static*/ Event IndexSpace::compute_intersections(const std::vector >& lhss, const std::vector >& rhss, std::vector >& results, @@ -299,7 +297,6 @@ namespace Realm { } template - __attribute__ ((noinline)) /*static*/ Event IndexSpace::compute_differences(const std::vector >& lhss, const std::vector >& rhss, std::vector >& results, diff --git a/runtime/realm/deppart/sparsity_impl.cc b/runtime/realm/deppart/sparsity_impl.cc index 93431b9493..7b46965328 100644 --- a/runtime/realm/deppart/sparsity_impl.cc +++ b/runtime/realm/deppart/sparsity_impl.cc @@ -159,7 +159,6 @@ namespace Realm { // call actual implementation - inlining makes this cheaper than a virtual method template - __attribute__ ((noinline)) Event SparsityMapPublicImpl::make_valid(bool precise /*= true*/) { return static_cast *>(this)->make_valid(precise); @@ -1011,70 +1010,10 @@ namespace Realm { Message::request(target, args); } - - // instantiation stuff - namespace { - -#define NT_INSTANTIATIONS(u, t) \ - t((SparsityMapPublicImpl *(SparsityMap::*)(void) const),(&SparsityMap::impl)) \ - u((SparsityMapImpl::lookup)) \ - t((Event (SparsityMapPublicImpl::*)(bool)),(&SparsityMapPublicImpl::make_valid)) \ - t((SparsityMap (*)(const std::vector >&, bool)),(&SparsityMap::construct)) \ - t((SparsityMap (*)(const std::vector >&, bool)),(&SparsityMap::construct)) \ - t((bool (SparsityMapImpl::*)(PartitioningMicroOp *, bool)),(&SparsityMapImpl::add_waiter)) \ - t((void (SparsityMapImpl::*)(void)),(&SparsityMapImpl::contribute_nothing)) - - struct UntypedWrapper { - template - static UntypedWrapper *wrap(T val); - }; - - template - struct TypedWrapper : public UntypedWrapper { - public: - TypedWrapper(T _val) : val(_val) {} - T val; - }; - - template - UntypedWrapper *UntypedWrapper::wrap(T val) - { - return new TypedWrapper(val); - } - - class NT_Instantiator { - public: - template - static void demux2(int tag, std::vector *v) - { -#define UNWRAP(x) x -#define UNTYPED(x) v->push_back(UntypedWrapper::wrap(&x)); -#define TYPED(t,x) v->push_back(UntypedWrapper::wrap(t x)); - NT_INSTANTIATIONS(UNTYPED, TYPED); - } - template - static void demux(int tag, std::vector *v) - { - demux2(tag, v); - } - }; - - // use our dynamic template demux stuff to enumerate all possible - // combinations of template paramters - void instantiate_stuff(int tag, std::vector *v) - { - NT_TemplateHelper::demux(tag, tag, v); - //NTF_TemplateHelper::demux(tag, tag, v); - //NTNT_TemplateHelper::demux(tag, tag, v); - } - }; - - //void (*dummy)(void) __attribute__((unused)) = &InstantiatePartitioningStuff<1,int>::inst_stuff; - void (*dummy)(int, std::vector *) __attribute__((weak, unused)) = &instantiate_stuff; - #define DOIT(N,T) \ template class SparsityMapPublicImpl; \ - template class SparsityMapImpl; + template class SparsityMapImpl; \ + template class SparsityMap; FOREACH_NT(DOIT) }; // namespace Realm