view src/parallel_execution/examples/bitonicSort/makeArray.cbc @ 1032:793b21a8ea12

fix include
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 24 Oct 2023 12:25:40 +0900
parents 4fdeb0afc187
children
line wrap: on
line source

#include <stdio.h>
#interface "Timer.h"

extern int length;
__code makeArray(__code next(struct SortArray* output, struct Timer* output1, ...)){
    if (output->loopCounter == 0){
        output->array = (Integer*)ALLOCATE_ARRAY(context, Integer, length);
        srand((unsigned) time(NULL));
    }
    if (output->loopCounter == GET_LEN(output->array)){
        printf("created Array\n");
        output->loopCounter = 0;
        goto output1->start(next(...));
    }
    output->array[output->loopCounter].value = rand() % 1000;
    //printf("%d\n", output->array[output->loopCounter]->value);
    output->loopCounter++;
    goto makeArray();
}