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: 董理 <dongli AT lasg.iap.ac.cn>
  • To: Phil Miller <mille121 AT illinois.edu>
  • Cc: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: Re: [charm] Could entry method argument type be a template argument?
  • Date: Thu, 10 Mar 2016 20:43:21 +0800

Dear Phil,

Thanks for quick replying! I just read chapter 15 of the manual, but I still have a concern that do we need to specify all the instantiations explicitly, which is feasible for native types, but not for user defined types?

Best regards,
Li

在 2016年3月10日,上午11:56,Phil Miller <mille121 AT illinois.edu> 写道:

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