# HG changeset patch # User Tatsuki IHA # Date 1513784065 -32400 # Node ID b6437feb04eea2b0bebefe6c10328f4c7dc2b625 # Parent 7d67c9cf09ee8c3b4b04f3dc1101a2818d6ac633 Running CUDA examples diff -r 7d67c9cf09ee -r b6437feb04ee src/parallel_execution/context.h --- a/src/parallel_execution/context.h Thu Dec 21 00:07:27 2017 +0900 +++ b/src/parallel_execution/context.h Thu Dec 21 00:34:25 2017 +0900 @@ -5,9 +5,9 @@ #include #ifdef USE_CUDAWorker #include -#include "../helper_cuda.h" #include #include +#include "helper_cuda.h" #endif #define ALLOCATE_SIZE 20000000 diff -r 7d67c9cf09ee -r b6437feb04ee src/parallel_execution/examples/twice/CUDAtwice.cbc --- a/src/parallel_execution/examples/twice/CUDAtwice.cbc Thu Dec 21 00:07:27 2017 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -#include -#include "../../../context.h" - - -extern void CUDAExec(struct Context* context, Array* array); - -__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 Array* array = &context->data[context->idg]->Array; - CUDAExec(context,array); - - //continuationにそってGPUworkerに戻る - goto meta(context, context->next); -}