Skip to content

Commit e304428

Browse files
committed
Refactor
1 parent c3558f5 commit e304428

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

bitonic_sort.cu

+2-9
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,14 @@ __global__ void bitonicSort(ARR_TYPE *a, ARR_TYPE nb, int step, int stage) {
2323
char working = (index % N) < shift;
2424
char ascending = (index / seqL) % 2 == 0;
2525

26-
if(index < nb && working){
27-
28-
if(index + shift > nb && working)
29-
printf("stp: %d, stg: %d, blckIdx: %d, thrdIdx: %d, idx: %d, shftdIdx: %d, wrk: %d, asc: %d, shft: %d\n",
30-
step, stage, blockIdx.x, threadIdx.x, index, index + shift, working, ascending, shift);
31-
26+
if(index < nb && working)
3227
if(ascending){
3328
if(a[index] > a[index + shift] == 1)
3429
swap(a + index, a + index + shift);
3530
}
3631
else
3732
if(a[index] < a[index + shift] == 1)
3833
swap(a + index, a + index + shift);
39-
}
4034
}
4135

4236

@@ -148,8 +142,7 @@ ARR_TYPE checkSorted(ARR_TYPE *a, ARR_TYPE nb){
148142
*b = temp;
149143
}
150144

151-
__device__ ARR_TYPE intPow(ARR_TYPE base, ARR_TYPE exp)
152-
{
145+
__device__ ARR_TYPE intPow(ARR_TYPE base, ARR_TYPE exp){
153146
ARR_TYPE result = 1;
154147
while (exp){
155148
if (exp % 2)

0 commit comments

Comments
 (0)