view src/parallel_execution/examples/twice/createArray.cbc @ 433:d920f3a3f037

Refactoring cuda.c
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Tue, 17 Oct 2017 15:47:33 +0900
parents 85b0ddbf458e
children 7679093bdd72
line wrap: on
line source

#include <stdio.h>

#include "../../../context.h"

extern int length;
extern int split;
extern int* array_ptr;

__code createArray(__code next(struct Array* output, ...)) {
    struct Array* output = *O_output;
    output->prefix = length/split;
    output->array  = array_ptr;
    output->size   = length;
    *O_output = output;
    printf("created Array\n");
    goto meta(context, context->next);
}

__code createArray_stub(struct Context* context) {
    Array** O_output = (struct Array **)&context->data[context->odg];
    goto createArray(context,
                     context->next,
                     O_output);
}