Am I wrong, or do you access out of array elements when you go down from your bottom image line?
(a->arrayPtr[sampleIndex +aheight + across].
nope, I believe you’re looking at my serial code. It runs fine.
Let me try to rephrase, I’m getting the correct output with the serial code, which is this:
[codebox]
111111111111111111111100111111111111111111111111111111111111
0111
111111111111111111111111011111111111111110111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111101111111111111111
1111
011101111111111111111111111111111111111111111111111111111111
0111
011111111111111111111111111111111111111111111111111111110011
1111
111111111111111111111111111111111111111110111111111111111111
1111
111100111111111111111111111111111111111111111111111111111111
1101
111111111110111111111111111111111111111111111111111111111111
1110
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111011111111111000111111111111111111111111111111111111
1011
111111111111111111110101111111111111111011111111111111111111
1111
111111111111111111111111111110111101111011111111111111111111
1111
111111111111111111111111011100111111010111111111101111111011
1111
111111111111111111111111111110011111100111111110011110111101
1111
111111111111111111111111111111111111101111111111111111111111
1111
111111111111111111111111111111111011111111111110111111111111
1111
111111111111111111111111011111011111111111111111111101111111
1111
111111111111111111111110111111111111111111111111111111111111
1111
111111111111111111110101111110111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111011
1111
111111111111111100111111111111111011111111111111111111111111
1111
111111111111111101111111111111011111111111111110111111111101
1110
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111011111111111111111111111111111111111111
1111
111111111111111111111001111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111101111111111110111
1111
111111111111111110111111111111111111111111111111111111111111
1111
111111110111111111111111111111111111011111111111111101011111
1111
111111111111111111111111111111111110111111111110111011111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
011111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111100111111111111111111111111111111111011111111111111
1111
111111001101111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111110101111111111111111111111110111111
1111
111111111111110111111111110101111111111111111111111111111111
1111
111111111111101111110111111111111111111111111111111111111111
1111
111111111111111111101111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111011111111
1111
111111111111111111111111111111111111111111111111111101111111
1111
111111111111111111111111111111001111111111111111111111111111
1111
111111111111111111111111111111110111111111111111111111111111
1111
110111111111111111111111111111111111111111111111011111111111
1011
111111111111111111111111111111111111111111110111111111111101
1111
111111001111111111111111111111111110111111111111111111111111
1111
111111001111111111011111111111111111111111111111111111111111
1111
111111100111111111111101111101111111111111111111111111111111
1111
111111000111111111111111111111111111111111110111111111111111
1111
111111100111111111111111111111111111111111111111111111111111
1111
111111101111111110111111101111111111111111111111111111111111
1111
111111011111111111111111111111111111111111111111111111111111
1111
111111101111111111111111111111111111111111110110111111011111
1111
011111101111111111110111111111111011111111111111011111111111
1111
111111111111111111111111111111111111111111111111011111011111
1110
111111111111111111111111001111111111111111111111111111111111
1100
111111111111111111111111111111111111111111111111111111111111
1111
100111111111111111111111111111111111111111111111111111111111
1111
[/codebox]
I also get the same correct result with this version of my parallel code:
[codebox]
111111111111111111111100111111111111111111111111111111111111
0111
111111111111111111111111011111111111111110111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111101111111111111111
1111
011101111111111111111111111111111111111111111111111111111111
0111
011111111111111111111111111111111111111111111111111111110011
1111
111111111111111111111111111111111111111110111111111111111111
1111
111100111111111111111111111111111111111111111111111111111111
1101
111111111110111111111111111111111111111111111111111111111111
1110
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111011111111111000111111111111111111111111111111111111
1011
111111111111111111110101111111111111111011111111111111111111
1111
111111111111111111111111111110111101111011111111111111111111
1111
111111111111111111111111011100111111010111111111101111111011
1111
111111111111111111111111111110011111100111111110011110111101
1111
111111111111111111111111111111111111101111111111111111111111
1111
111111111111111111111111111111111011111111111110111111111111
1111
111111111111111111111111011111011111111111111111111101111111
1111
111111111111111111111110111111111111111111111111111111111111
1111
111111111111111111110101111110111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
101111111111111111111111111111111111111111111111111111111011
1111
111111111111111100111111111111111011111111111111111111111111
1111
011111111111111101111111111111011111111111111110111111111101
1110
001111111111111111111111111111111111111111111111111111111111
1111
011111111111111111111011111111111111111111111111111111111111
1111
011111111111111111111001111111111111111111111111111111111111
1111
011111111111111111111111111111111111111111101111111111110111
1111
101111111111111110111111111111111111111111111111111111111111
1111
111111110111111111111111111111111111011111111111111101011111
1111
011111111111111111111111111111111110111111111110111011111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
011111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111100111111111111111111111111111111111011111111111111
1111
111111001101111111111111111111111111111111111111111111111111
1111
111111111111111111111111111111111111111111111111111111111111
1111
111111111111111111111111110101111111111111111111111110111111
1111
111111111111110111111111110101111111111111111111111111111111
1111
111111111111101111110111111111111111111111111111111111111111
1111
111111111111111111101111111111111111111111111111111111111111
1111
011111111111111111111111111111111111111111111111111111111111
1111
101111111111111111111111111111111111111111111111111011111111
1111
001111111111111111111111111111111111111111111111111101111111
1111
011111111111111111111111111111001111111111111111111111111111
1111
111111111111111111111111111111110111111111111111111111111111
1111
010111111111111111111111111111111111111111111111011111111111
1011
111111111111111111111111111111111111111111110111111111111101
1111
001111001111111111111111111111111110111111111111111111111111
1111
101111001111111111011111111111111111111111111111111111111111
1111
101111100111111111111101111101111111111111111111111111111111
1111
111111000111111111111111111111111111111111110111111111111111
1111
111111100111111111111111111111111111111111111111111111111111
1111
011111101111111110111111101111111111111111111111111111111111
1111
011111011111111111111111111111111111111111111111111111111111
1111
111111101111111111111111111111111111111111110110111111000000
0000
011111101111111111110111111111111011111111111111011111100000
0000
111111111111111111111111111111111111111111111111011111000000
0000
111111111111111111111111001111111111111111111111111111100000
0000
111111111111111111111111111111111111111111111111111111100000
0000
100111111111111111111111111111111111111111111111111111100000
0000
[/codebox]
I get extra zeros at random places, and all I did was replace
for (i=0;i<resultWidth;i++)
with
i = blockIdx.x * blockDim.x + threadIdx.x;
sorry for how the outputs don’t line up exactly.
would this be caused by rounding errors??? but comparing 0’s and 1’s shouldn’t result in rounding errors, right?