charm AT lists.siebelschool.illinois.edu
Subject: Charm++ parallel programming system
List archive
[charm] What if CkReductionTarget's argument is a type that is template argument?
Chronological Thread
- From: Jozsef Bakosi <jbakosi AT gmail.com>
- To: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
- Subject: [charm] What if CkReductionTarget's argument is a type that is template argument?
- Date: Fri, 17 Apr 2015 15:18:27 -0600
- List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
- List-id: CHARM parallel programming system <charm.cs.uiuc.edu>
Hi folks,
How can I create a callback to a driver whose type is a template argument?
In essence, I want to add a line CkReduction(...) in my class that is templated on the type to which I want to call back.
I see that CkReductionTarget is a macro:
CkReductionTarget(me, method) CkIndex_##me::redn_wrapper_##method(NULL)
which creates "CkIndex_<DRIVER>" from the first argument '<DRIVER>'. This requires hardcoding the specialized <DRIVER>'s name to the call, which will fail for a different template argument. I cannot pass the template argument to the macro since preprocessing happens earlier than type resolution and the string of the template argument will be substituted instead of the type specialized.
I could use template metaprogramming to get the CkIndex_<DRIVER> type from type <DRIVER> at compile time and so I could generate what the macro generates, but I don't know what "redn_wrapper_" stands for.
Does someone have an idea how to resolve this?
Thanks,
Jozsef
- [charm] What if CkReductionTarget's argument is a type that is template argument?, Jozsef Bakosi, 04/17/2015
Archive powered by MHonArc 2.6.16.