Mercurial > hg > Members > Moririn
changeset 465:b6437feb04ee
Running CUDA examples
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 21 Dec 2017 00:34:25 +0900 |
parents | 7d67c9cf09ee |
children | 831b7f6fd687 |
files | src/parallel_execution/context.h src/parallel_execution/examples/twice/CUDAtwice.cbc |
diffstat | 2 files changed, 1 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- 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 <pthread.h> #ifdef USE_CUDAWorker #include <cuda.h> -#include "../helper_cuda.h" #include <driver_types.h> #include <cuda_runtime.h> +#include "helper_cuda.h" #endif #define ALLOCATE_SIZE 20000000
--- 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 <stdio.h> -#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); -}