Skip to Content.
Sympa Menu

charm - Re: [charm] Could entry method argument type be a template argument?

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Could entry method argument type be a template argument?


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: 董理 <dongli AT lasg.iap.ac.cn>
  • Cc: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: Re: [charm] Could entry method argument type be a template argument?
  • Date: Wed, 9 Mar 2016 21:56:39 -0600

You can put "template <typename DataType>" before the "chare Foo" declaration, just like in your class declaration. You'll also need to have specific instantiations declared explicitly. See the Charm++ manual for more details.

Individual entry methods can also be declared as templates.

On Mar 9, 2016 7:48 PM, "董理" <dongli AT lasg.iap.ac.cn> wrote:
Dear all,

I would like to know if the argument type of an entry method is a template argument, how to deal with it? The following is a simplified example:

chare Foo {
  entry void bar(<DataType> x); // <— How to express ‘DataType’?
};

template <typename DataType>
class Foo : public CBase_Foo {
public:
  void bar(DataType x);
};

The reason why I am using template on chare object is that the user of my codes can use different data type, such as double, int.

Best regards,
Li



Archive powered by MHonArc 2.6.16.

Top of Page