Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] starpu_codelet must be global?

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] starpu_codelet must be global?


Chronologique Discussions 
  • From: Miguel Palhas <mpalhas@gmail.com>
  • To: Samuel Thibault <samuel.thibault@ens-lyon.org>, Miguel Palhas <mpalhas@gmail.com>, starpu-devel@lists.gforge.inria.fr
  • Subject: Re: [Starpu-devel] starpu_codelet must be global?
  • Date: Tue, 30 Apr 2013 16:07:48 +0100
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

Oh, wasn't aware of that difference. Guess i'm too used to C++

Thanks


On Tue, Apr 30, 2013 at 4:02 PM, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
Miguel Palhas, le Tue 30 Apr 2013 16:59:45 +0200, a écrit :
> The original sample declares a global variable, struct starpu_codelet cl. I
> tried to make this variable local to the main function, basically doing this:
>
> // this is the old variable, commented out
> // struct starpu_codelet cl;
>
> int main() {
>   ...
>   // and this is the new one
>   struct starpu_codelet cl;

Please take care: in C global variables are initialized to 0, while local
variables are not. You need to use:

    struct starpu_codelet cl = { };

Samuel



--
Cumprimentos
Miguel Palhas



Archives gérées par MHonArc 2.6.19+.

Haut de le page