#include #include "../context.h" extern void CUDAExec(struct Context* context, Array* array, LoopCounter *loopCounter) ; __code CUDAtwice(struct Context* context, struct LoopCounter* loopCounter, int index, int prefix, int* array, struct Context* workerContext) { int i = loopCounter->i; if (i < prefix) { array[i+index*prefix] = array[i+index*prefix]*2; loopCounter->i++; goto meta(context, C_twice); } loopCounter->i = 0; goto meta(workerContext, workerContext->next); } __code CUDAtwice_stub(struct Context* context) { printf("CUdAtwice stub\n"); struct LoopCounter* loopCounter = &context->data[context->dataNum]->LoopCounter; struct Array* array = &context->data[context->dataNum+1]->Array; CUDAExec(context,array,loopCounter); //continuationにそってGPUworkerに戻る goto meta(context, context->next); }