view src/parallel_execution/examples/calc/initIntegerDataGears.cbc @ 381:b81492c74d2b

Create examples directory
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Mon, 24 Jul 2017 16:52:09 +0900
parents src/parallel_execution/examples/InitIntegerDataGears.cbc@c3a7a086e82a
children 929aa06a12f9
line wrap: on
line source

#include "../../../context.h"
#include <stdio.h>
__code initIntegerDataGears(__code next(struct Integer* output1, struct Integer* output2, struct Integer* output3, ...)) {
    struct Integer* output1 = *O_output1;
    struct Integer* output2 = *O_output2;
    struct Integer* output3 = *O_output3;
    output1->value = 1;
    output2->value = 2;
    output3->value = 3;
    *O_output1 = output1;
    *O_output2 = output2;
    *O_output3 = output3;
    goto meta(context, next);
}

__code initIntegerDataGears_stub(struct Context* context) {
    Integer** O_output1 = (struct Integer **)&context->data[context->odg];
    Integer** O_output2 = (struct Integer **)&context->data[context->odg+1];
    Integer** O_output3 = (struct Integer **)&context->data[context->odg+2];
    goto initIntegerDataGears(context,
            context->next,
            O_output1,
            O_output2,
            O_output3);
}