Mercurial > hg > Members > Moririn
changeset 413:497b154141de
Call CUDAExec by twice_stub
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Sep 2017 22:28:52 +0900 |
parents | 409e6b5fb775 |
children | 49159fbdd1fb |
files | src/parallel_execution/CMakeLists.txt src/parallel_execution/examples/twice/main.cbc src/parallel_execution/examples/twice/twice.cbc |
diffstat | 3 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt Thu Sep 14 19:11:25 2017 +0900 +++ b/src/parallel_execution/CMakeLists.txt Thu Sep 14 22:28:52 2017 +0900 @@ -83,7 +83,7 @@ TARGET CUDAtwice SOURCES - examples/twice/main.cbc examples/twice/CUDAtwice.cbc examples/twice/CUDAtwice.cu examples/twice/createArray.cbc CPUWorker.cbc TimeImpl.cbc examples/twice/twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc CUDAWorker.cbc cuda.c MultiDimIterator.cbc + examples/twice/main.cbc examples/twice/twice.cbc examples/twice/CUDAtwice.cu examples/twice/createArray.cbc CPUWorker.cbc TimeImpl.cbc examples/twice/twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc CUDAWorker.cbc cuda.c MultiDimIterator.cbc ) set_target_properties(CUDAtwice PROPERTIES COMPILE_FLAGS "-Wall -g -DUSE_CUDAWorker=1") endif()
--- a/src/parallel_execution/examples/twice/main.cbc Thu Sep 14 19:11:25 2017 +0900 +++ b/src/parallel_execution/examples/twice/main.cbc Thu Sep 14 22:28:52 2017 +0900 @@ -97,11 +97,7 @@ par goto createArray(array, __exit); - if(gpu_num) { - par goto CUDAtwice(array, iterate(split), __exit); - } else { - par goto twice(array, iterate(split), __exit); - } + par goto twice(array, iterate(split), __exit); goto code2(); }
--- a/src/parallel_execution/examples/twice/twice.cbc Thu Sep 14 19:11:25 2017 +0900 +++ b/src/parallel_execution/examples/twice/twice.cbc Thu Sep 14 22:28:52 2017 +0900 @@ -2,6 +2,10 @@ #include "../../../context.h" +#ifdef USE_CUDAWorker +extern void CUDAExec(struct Context* context, Array* array); +#endif + __code twice(struct Array* array, struct MultiDim* multiDim, __code next(...), struct LoopCounter* loopCounter) { int i = loopCounter->i; int index = multiDim->x; @@ -17,6 +21,14 @@ } __code twice_stub(struct Context* context) { +#ifdef USE_CUDAWorker + struct Array* array = &context->data[context->idg]->Array; + if (context->gpu) { + CUDAExec(context, array); + } + //continuationにそってGPUworkerに戻る + goto meta(context, context->next); +#endif goto twice(context, &context->data[context->idg]->Array, &context->data[context->idg+1]->MultiDim,