Mercurial > hg > GearsTemplate
changeset 528:82ff74c2f162
Delete stub for bitonicSort
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 27 Jan 2018 22:25:33 +0900 |
parents | 929aa06a12f9 |
children | e5e3025f503a |
files | src/parallel_execution/examples/bitonicSort/bitonicSwap.cbc src/parallel_execution/examples/bitonicSort/makeArray.cbc src/parallel_execution/examples/bitonicSort/printArray.cbc src/parallel_execution/generate_stub.pl |
diffstat | 4 files changed, 6 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/examples/bitonicSort/bitonicSwap.cbc Sat Jan 27 21:45:58 2018 +0900 +++ b/src/parallel_execution/examples/bitonicSort/bitonicSwap.cbc Sat Jan 27 22:25:33 2018 +0900 @@ -6,7 +6,6 @@ #endif __code bitonicSwap(struct SortArray* inputArray, struct MultiDim* multiDim, __code next(struct SortArray* output, ...), struct LoopCounter* loopCounter) { - struct SortArray* output = *O_output; int block = inputArray->block; int first = inputArray->first; if (loopCounter->i < inputArray->prefix) { @@ -21,12 +20,11 @@ array[index2] = tmp; } loopCounter->i++; - goto meta(context, C_bitonicSwap); + goto bitonicSwap(); } loopCounter->i = 0; output->array = inputArray->array; - *O_output = output; - goto meta(context, next); + goto next(output, ...); } __code bitonicSwap_stub(struct Context* context) {
--- a/src/parallel_execution/examples/bitonicSort/makeArray.cbc Sat Jan 27 21:45:58 2018 +0900 +++ b/src/parallel_execution/examples/bitonicSort/makeArray.cbc Sat Jan 27 22:25:33 2018 +0900 @@ -4,8 +4,6 @@ extern int length; __code makeArray(__code next(struct SortArray* output, struct Timer* output1, ...)){ - struct SortArray* output = *O_output; - struct Timer* output1 = *O_output1; if (output->loopCounter == 0){ output->array = (Integer*)ALLOCATE_ARRAY(context, Integer, length); srand((unsigned) time(NULL)); @@ -13,16 +11,12 @@ if (output->loopCounter == GET_LEN(output->array)){ printf("created Array\n"); output->loopCounter = 0; - *O_output = output; - *O_output1 = output1; goto output1->start(next(...)); } output->array[output->loopCounter].value = rand() % 1000; //printf("%d\n", output->array[output->loopCounter]->value); output->loopCounter++; - *O_output = output; - *O_output1 = output1; - goto meta(context, C_makeArray); + goto makeArray(); } __code makeArray_stub(struct Context* context) {
--- a/src/parallel_execution/examples/bitonicSort/printArray.cbc Sat Jan 27 21:45:58 2018 +0900 +++ b/src/parallel_execution/examples/bitonicSort/printArray.cbc Sat Jan 27 22:25:33 2018 +0900 @@ -6,30 +6,17 @@ goto inputTimer->end(printArray1); } -__code printArray_stub(struct Context* context) { - goto printArray(context, - &context->data[context->idg]->SortArray, - &context->data[context->idg+1]->Timer, - context->next); -} - __code printArray1(struct SortArray* inputArray, __code next(...)){ //printf("%d\n", inputArray->array[inputArray->loopCounter].value); inputArray->loopCounter++; if (inputArray->loopCounter == GET_LEN(inputArray->array)){ printf("sort completed\n"); inputArray->loopCounter = 0; - goto meta(context, next); + goto next(...); } if (inputArray->array[inputArray->loopCounter-1].value > inputArray->array[inputArray->loopCounter].value) { printf("wrong result\n"); goto meta(context, next); } - goto meta(context, C_printArray1); + goto printArray1(); } - -__code printArray1_stub(struct Context* context) { - goto printArray1(context, - &context->data[context->idg]->SortArray, - context->next); -}
--- a/src/parallel_execution/generate_stub.pl Sat Jan 27 21:45:58 2018 +0900 +++ b/src/parallel_execution/generate_stub.pl Sat Jan 27 22:25:33 2018 +0900 @@ -452,7 +452,7 @@ my $ftype; for my $v (@{$dataGearVar{$codeGearName}}) { my $t = shift @types; - if ($v eq $next) { + if ($v eq $next || $v eq "O_$next") { $ntype = $t; $ftype = lcfirst($ntype); }