|
Hi! I just faced a strange problem running radix sort demo. It compiles properly, without any warnings in CL kernels, but execution produces incorrect results. These results look like they've undergone data races or incorrect bit operations -- for example (for maxValue = 10), the program outputs the following:
= = = workgroup size: 128 = = =
array size: 0.131072MB; elements: 32K
snapshot before sorting: 0, 3, 8, 4, 0, 5, 5, 8, 9, 3, 2, 2, 6, 2, 6, 2, 6, 0, 3, 9, ...; 32748 more
time: 6.600048ms
time: 5.044378ms
time: 4.78385ms
time: 4.060292ms
time: 3.898054ms
time: 3.924897ms
time: 3.750422ms
time: 5.213722ms
time: 4.366611ms
time: 4.253321ms
snapshot: 0, 0, 2, 4, 7, 0, 0, 13, 0, 0, 2, 4, 7, 0, 0, 13, 0, 0, 0, 0, ...; 32748 more
validating...
Exception in thread "main" java.lang.RuntimeException: not sorted 7 !> 0
The set looks sorted only partially, like when data races occur. Furthermore, I presume that no numbers greater than 9 could appear in data set during normal execution. I tried -Werror and -cl-opt-disable for CL builds, but this doesnt help -- nor the problem disappears, neither the builds fall with errors. Could someone please help me with this issue?
|