Mercurial > hg > Members > Moririn
changeset 420:764c92c3b181
Fix
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 06 Oct 2017 15:10:07 +0900 |
parents | 49159fbdd1fb |
children | 08fc3e5c8b81 |
files | src/parallel_execution/CMakeLists.txt src/parallel_execution/examples/bitonicSort/CUDAbitonicSwap.cu src/parallel_execution/examples/twice/CUDAtwice.cu |
diffstat | 3 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt Fri Sep 15 22:49:45 2017 +0900 +++ b/src/parallel_execution/CMakeLists.txt Fri Oct 06 15:10:07 2017 +0900 @@ -85,7 +85,7 @@ SOURCES 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") + set_target_properties(CUDAtwice PROPERTIES COMPILE_FLAGS "-Wall -g -DUSE_CUDAWorker=1") # -DUSE_CUDA_MAIN_THREAD GearsCommand( TARGET
--- a/src/parallel_execution/examples/bitonicSort/CUDAbitonicSwap.cu Fri Sep 15 22:49:45 2017 +0900 +++ b/src/parallel_execution/examples/bitonicSort/CUDAbitonicSwap.cu Fri Oct 06 15:10:07 2017 +0900 @@ -9,7 +9,7 @@ int i = 0; C_bitonicSwap: if (i < prefix) { - int index = i + blockIdx.x * prefix; + int index = i + (blockIdx.x * blockDim.x + threadIdx.x) * prefix; int position = index/block; int index1 = index+block*position; int index2 = (first == 1)? ((block<<1)*(position+1))-(index1%block)-1 : index1+block;
--- a/src/parallel_execution/examples/twice/CUDAtwice.cu Fri Sep 15 22:49:45 2017 +0900 +++ b/src/parallel_execution/examples/twice/CUDAtwice.cu Fri Oct 06 15:10:07 2017 +0900 @@ -4,7 +4,7 @@ int prefix = *prefixPtr; C_twice: if (i < prefix) { - array[i+blockIdx.x*prefix] = array[i+blockIdx.x*prefix]*2; + array[i+(blockIdx.x*blockDim.x+threadIdx.x)*prefix] = array[i+(blockIdx.x*blockDim.x+threadIdx.x)*prefix]*2; i++; goto C_twice; }