Mercurial > hg > Game > Cerium
changeset 2036:6fafe38d0508 draft
fix
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 06 Feb 2015 00:20:01 +0900 |
parents | 33af6d6e1bfc |
children | 0b3d1d2863c8 |
files | example/bitonic_sort/ppe/swap.cc |
diffstat | 1 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/example/bitonic_sort/ppe/swap.cc Thu Feb 05 23:48:49 2015 +0900 +++ b/example/bitonic_sort/ppe/swap.cc Fri Feb 06 00:20:01 2015 +0900 @@ -10,22 +10,21 @@ int index = s->x; long block = (long)s->get_param(0); long dist = (long)s->get_param(1); - long sp = (long)s->get_param(2); + long diff = (long)s->get_param(2); - int x = index/block; - int y = index/sp; - int i = index+sp*y; - int temp = inData[i]; + int spot = index/block; + index = index+diff*(index/diff); + int temp = inData[index]; - if (x%2 == 0) { - if (inData[i+dist] < inData[i]) { - outData[i] = inData[i+dist]; - outData[i+dist] = temp; + if (spot%2 == 0) { + if (inData[index+dist] < inData[index]) { + outData[index] = inData[index+dist]; + outData[index+dist] = temp; } } else { - if (inData[i] < inData[i+dist]) { - outData[i] = inData[i+dist]; - outData[i+dist] = temp; + if (inData[index] < inData[index+dist]) { + outData[index] = inData[index+dist]; + outData[index+dist] = temp; } }