<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
the	O
prefix	B-Application
sum	I-Application
,	O
cumulative	O
sum	O
,	O
inclusive	O
scan	O
,	O
or	O
simply	O
scan	O
of	O
a	O
sequence	O
of	O
numbers	O
is	O
a	O
second	O
sequence	O
of	O
numbers	O
,	O
the	O
sums	O
of	O
prefixes	O
(	O
running	O
totals	O
)	O
of	O
the	O
input	O
sequence	O
:	O
</s>
<s>
For	O
instance	O
,	O
the	O
prefix	B-Application
sums	I-Application
of	O
the	O
natural	O
numbers	O
are	O
the	O
triangular	O
numbers	O
:	O
</s>
<s>
Prefix	B-Application
sums	I-Application
are	O
trivial	O
to	O
compute	O
in	O
sequential	O
models	O
of	O
computation	O
,	O
by	O
using	O
the	O
formula	O
to	O
compute	O
each	O
output	O
value	O
in	O
sequence	O
order	O
.	O
</s>
<s>
However	O
,	O
despite	O
their	O
ease	O
of	O
computation	O
,	O
prefix	B-Application
sums	I-Application
are	O
a	O
useful	O
primitive	O
in	O
certain	O
algorithms	O
such	O
as	O
counting	B-Algorithm
sort	I-Algorithm
,	O
</s>
<s>
and	O
they	O
form	O
the	O
basis	O
of	O
the	O
scan	O
higher-order	B-Language
function	I-Language
in	O
functional	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
Prefix	B-Application
sums	I-Application
have	O
also	O
been	O
much	O
studied	O
in	O
parallel	B-Operating_System
algorithms	I-Operating_System
,	O
both	O
as	O
a	O
test	O
problem	O
to	O
be	O
solved	O
and	O
as	O
a	O
useful	O
primitive	O
to	O
be	O
used	O
as	O
a	O
subroutine	O
in	O
other	O
parallel	B-Operating_System
algorithms	I-Operating_System
.	O
</s>
<s>
Abstractly	O
,	O
a	O
prefix	B-Application
sum	I-Application
requires	O
only	O
a	O
binary	O
associative	O
operator	O
⊕	O
,	O
making	O
it	O
useful	O
for	O
many	O
applications	O
from	O
calculating	O
well-separated	O
pair	O
decompositions	O
of	O
points	O
to	O
string	O
processing	O
.	O
</s>
<s>
Mathematically	O
,	O
the	O
operation	O
of	O
taking	O
prefix	B-Application
sums	I-Application
can	O
be	O
generalized	O
from	O
finite	O
to	O
infinite	O
sequences	O
;	O
in	O
that	O
context	O
,	O
a	O
prefix	B-Application
sum	I-Application
is	O
known	O
as	O
a	O
partial	O
sum	O
of	O
a	O
series	O
.	O
</s>
<s>
Prefix	O
summation	O
or	O
partial	O
summation	O
form	O
linear	B-Architecture
operators	I-Architecture
on	O
the	O
vector	O
spaces	O
of	O
finite	O
or	O
infinite	O
sequences	O
;	O
their	O
inverses	O
are	O
finite	B-Algorithm
difference	I-Algorithm
operators	O
.	O
</s>
<s>
In	O
functional	B-Language
programming	I-Language
terms	O
,	O
the	O
prefix	B-Application
sum	I-Application
may	O
be	O
generalized	O
to	O
any	O
binary	O
operation	O
(	O
not	O
just	O
the	O
addition	O
operation	O
)	O
;	O
the	O
higher	B-Language
order	I-Language
function	I-Language
resulting	O
from	O
this	O
generalization	O
is	O
called	O
a	O
scan	O
,	O
and	O
it	O
is	O
closely	O
related	O
to	O
the	O
fold	B-Application
operation	O
.	O
</s>
<s>
Both	O
the	O
scan	O
and	O
the	O
fold	B-Application
operations	O
apply	O
the	O
given	O
binary	O
operation	O
to	O
the	O
same	O
sequence	O
of	O
values	O
,	O
but	O
differ	O
in	O
that	O
the	O
scan	O
returns	O
the	O
whole	O
sequence	O
of	O
results	O
from	O
the	O
binary	O
operation	O
,	O
whereas	O
the	O
fold	B-Application
returns	O
only	O
the	O
final	O
result	O
.	O
</s>
<s>
Either	O
type	O
of	O
scan	O
can	O
be	O
transformed	O
into	O
the	O
other	O
:	O
an	O
inclusive	O
scan	O
can	O
be	O
transformed	O
into	O
an	O
exclusive	O
scan	O
by	O
shifting	O
the	O
array	B-Data_Structure
produced	O
by	O
the	O
scan	O
right	O
by	O
one	O
element	O
and	O
inserting	O
the	O
identity	O
value	O
at	O
the	O
left	O
of	O
the	O
array	B-Data_Structure
.	O
</s>
<s>
Conversely	O
,	O
an	O
exclusive	O
scan	O
be	O
transformed	O
into	O
an	O
inclusive	O
scan	O
by	O
shifting	O
the	O
array	B-Data_Structure
produced	O
by	O
the	O
scan	O
left	O
and	O
inserting	O
the	O
sum	O
of	O
the	O
last	O
element	O
of	O
the	O
scan	O
and	O
the	O
last	O
element	O
of	O
the	O
input	O
array	B-Data_Structure
at	O
the	O
right	O
of	O
the	O
array	B-Data_Structure
.	O
</s>
<s>
There	O
are	O
two	O
key	O
algorithms	O
for	O
computing	O
a	O
prefix	B-Application
sum	I-Application
in	O
parallel	O
.	O
</s>
<s>
following	O
parallel	O
prefix	B-Application
sum	I-Application
algorithm	O
:	O
</s>
<s>
In	O
the	O
above	O
,	O
the	O
notation	O
means	O
the	O
value	O
of	O
the	O
th	O
element	O
of	O
array	B-Data_Structure
in	O
timestep	O
.	O
</s>
<s>
A	O
work-efficient	O
parallel	O
prefix	B-Application
sum	I-Application
can	O
be	O
computed	O
by	O
the	O
following	O
steps	O
.	O
</s>
<s>
The	O
number	O
of	O
steps	O
of	O
the	O
algorithm	O
is	O
,	O
and	O
it	O
can	O
be	O
implemented	O
on	O
a	O
parallel	B-Operating_System
random	I-Operating_System
access	I-Operating_System
machine	I-Operating_System
with	O
processors	O
without	O
any	O
asymptotic	O
slowdown	O
by	O
assigning	O
multiple	O
indices	O
to	O
each	O
processor	O
in	O
rounds	O
of	O
the	O
algorithm	O
for	O
which	O
there	O
are	O
more	O
elements	O
than	O
processors	O
.	O
</s>
<s>
Parallel	B-Operating_System
algorithms	I-Operating_System
for	O
prefix	B-Application
sums	I-Application
can	O
often	O
be	O
generalized	O
to	O
other	O
scan	O
operations	O
on	O
associative	O
binary	O
operations	O
,	O
and	O
they	O
can	O
also	O
be	O
computed	O
efficiently	O
on	O
modern	O
parallel	O
hardware	O
such	O
as	O
a	O
GPU	B-Architecture
.	O
</s>
<s>
Many	O
parallel	O
implementations	O
follow	O
a	O
two	O
pass	O
procedure	O
where	O
partial	O
prefix	B-Application
sums	I-Application
are	O
calculated	O
in	O
the	O
first	O
pass	O
on	O
each	O
processing	O
unit	O
;	O
the	O
prefix	B-Application
sum	I-Application
of	O
these	O
partial	O
sums	O
is	O
then	O
calculated	O
and	O
broadcast	O
back	O
to	O
the	O
processing	O
units	O
for	O
a	O
second	O
pass	O
using	O
the	O
now	O
known	O
prefix	O
as	O
the	O
initial	O
value	O
.	O
</s>
<s>
An	O
implementation	O
of	O
a	O
parallel	O
prefix	B-Application
sum	I-Application
algorithm	O
,	O
like	O
other	O
parallel	B-Operating_System
algorithms	I-Operating_System
,	O
has	O
to	O
take	O
the	O
parallelization	B-Application
architecture	I-Application
of	O
the	O
platform	O
into	O
account	O
.	O
</s>
<s>
More	O
specifically	O
,	O
multiple	O
algorithms	O
exist	O
which	O
are	O
adapted	O
for	O
platforms	O
working	O
on	O
shared	B-Operating_System
memory	I-Operating_System
as	O
well	O
as	O
algorithms	O
which	O
are	O
well	O
suited	O
for	O
platforms	O
using	O
distributed	B-Operating_System
memory	I-Operating_System
,	O
relying	O
on	O
message	B-Architecture
passing	I-Architecture
as	O
the	O
only	O
form	O
of	O
interprocess	O
communication	O
.	O
</s>
<s>
The	O
following	O
algorithm	O
assumes	O
a	O
shared	B-Operating_System
memory	I-Operating_System
machine	O
model	O
;	O
all	O
processing	O
elements	O
(	O
PEs	O
)	O
have	O
access	O
to	O
the	O
same	O
memory	O
.	O
</s>
<s>
A	O
version	O
of	O
this	O
algorithm	O
is	O
implemented	O
in	O
the	O
Multi-Core	O
Standard	B-Application
Template	I-Application
Library	I-Application
(	O
MCSTL	O
)	O
,	O
a	O
parallel	O
implementation	O
of	O
the	O
C++	B-Application
standard	I-Application
template	I-Application
library	I-Application
which	O
provides	O
adapted	O
versions	O
for	O
parallel	O
computing	O
of	O
various	O
algorithms	O
.	O
</s>
<s>
In	O
order	O
to	O
concurrently	O
calculate	O
the	O
prefix	B-Application
sum	I-Application
over	O
data	O
elements	O
with	O
processing	O
elements	O
,	O
the	O
data	O
is	O
divided	O
into	O
blocks	O
,	O
each	O
containing	O
elements	O
(	O
for	O
simplicity	O
we	O
assume	O
that	O
divides	O
)	O
.	O
</s>
<s>
In	O
a	O
first	O
sweep	O
,	O
each	O
PE	O
calculates	O
a	O
local	O
prefix	B-Application
sum	I-Application
for	O
its	O
block	O
.	O
</s>
<s>
The	O
last	O
block	O
does	O
not	O
need	O
to	O
be	O
calculated	O
,	O
since	O
these	O
prefix	B-Application
sums	I-Application
are	O
only	O
calculated	O
as	O
offsets	O
to	O
the	O
prefix	B-Application
sums	I-Application
of	O
succeeding	O
blocks	O
and	O
the	O
last	O
block	O
is	O
by	O
definition	O
not	O
succeeded	O
.	O
</s>
<s>
The	O
offsets	O
which	O
are	O
stored	O
in	O
the	O
last	O
position	O
of	O
each	O
block	O
are	O
accumulated	O
in	O
a	O
prefix	B-Application
sum	I-Application
of	O
their	O
own	O
and	O
stored	O
in	O
their	O
succeeding	O
positions	O
.	O
</s>
<s>
However	O
,	O
in	O
this	O
sweep	O
the	O
last	O
block	O
is	O
included	O
instead	O
and	O
the	O
prefix	B-Application
sums	I-Application
for	O
each	O
block	O
are	O
calculated	O
taking	O
the	O
prefix	B-Application
sum	I-Application
block	O
offsets	O
calculated	O
in	O
the	O
previous	O
sweep	O
into	O
account	O
.	O
</s>
<s>
The	O
Hypercube	B-Architecture
Prefix	B-Application
Sum	I-Application
Algorithm	O
is	O
well	O
adapted	O
for	O
distributed	B-Operating_System
memory	I-Operating_System
platforms	O
and	O
works	O
with	O
the	O
exchange	O
of	O
messages	O
between	O
the	O
processing	O
elements	O
.	O
</s>
<s>
It	O
assumes	O
to	O
have	O
processor	O
elements	O
(	O
PEs	O
)	O
participating	O
in	O
the	O
algorithm	O
equal	O
to	O
the	O
number	O
of	O
corners	O
in	O
a	O
-dimensional	O
hypercube	B-Architecture
.	O
</s>
<s>
Throughout	O
the	O
algorithm	O
,	O
each	O
PE	O
is	O
seen	O
as	O
a	O
corner	O
in	O
a	O
hypothetical	O
hyper	O
cube	O
with	O
knowledge	O
of	O
the	O
total	O
prefix	B-Application
sum	I-Application
as	O
well	O
as	O
the	O
prefix	B-Application
sum	I-Application
of	O
all	O
elements	O
up	O
to	O
itself	O
(	O
according	O
to	O
the	O
ordered	O
indices	O
among	O
the	O
PEs	O
)	O
,	O
both	O
in	O
its	O
own	O
hypercube	B-Architecture
.	O
</s>
<s>
The	O
algorithm	O
starts	O
by	O
assuming	O
every	O
PE	O
is	O
the	O
single	O
corner	O
of	O
a	O
zero	O
dimensional	O
hyper	O
cube	O
and	O
therefore	O
and	O
are	O
equal	O
to	O
the	O
local	O
prefix	B-Application
sum	I-Application
of	O
its	O
own	O
elements	O
.	O
</s>
<s>
During	O
each	O
unification	O
,	O
is	O
exchanged	O
and	O
aggregated	O
between	O
the	O
two	O
hyper	O
cubes	O
which	O
keeps	O
the	O
invariant	O
that	O
all	O
PEs	O
at	O
corners	O
of	O
this	O
new	O
hyper	O
cube	O
store	O
the	O
total	O
prefix	B-Application
sum	I-Application
of	O
this	O
newly	O
unified	O
hyper	O
cube	O
in	O
their	O
variable	O
.	O
</s>
<s>
However	O
,	O
only	O
the	O
hyper	O
cube	O
containing	O
the	O
PEs	O
with	O
higher	O
index	O
also	O
adds	O
this	O
to	O
their	O
local	O
variable	O
,	O
keeping	O
the	O
invariant	O
that	O
only	O
stores	O
the	O
value	O
of	O
the	O
prefix	B-Application
sum	I-Application
of	O
all	O
elements	O
at	O
PEs	O
with	O
indices	O
smaller	O
or	O
equal	O
to	O
their	O
own	O
index	O
.	O
</s>
<s>
The	O
Pipelined	O
Binary	O
Tree	O
Algorithm	O
is	O
another	O
algorithm	O
for	O
distributed	B-Operating_System
memory	I-Operating_System
platforms	O
which	O
is	O
specifically	O
well	O
suited	O
for	O
large	O
message	O
sizes	O
.	O
</s>
<s>
Like	O
the	O
hypercube	B-Architecture
algorithm	O
,	O
it	O
assumes	O
a	O
special	O
communication	O
structure	O
.	O
</s>
<s>
The	O
local	O
prefix	B-Application
sum	I-Application
of	O
the	O
left	O
subtree	O
has	O
to	O
be	O
aggregated	O
to	O
calculate	O
PEj	O
's	O
local	O
prefix	B-Application
sum	I-Application
.	O
</s>
<s>
The	O
local	O
prefix	B-Application
sum	I-Application
of	O
the	O
right	O
subtree	O
has	O
to	O
be	O
aggregated	O
to	O
calculate	O
the	O
local	O
prefix	B-Application
sum	I-Application
of	O
higher	O
level	O
PEh	O
which	O
are	O
reached	O
on	O
a	O
path	O
containing	O
a	O
left	O
children	O
connection	O
(	O
which	O
means	O
)	O
.	O
</s>
<s>
The	O
total	O
prefix	B-Application
sum	I-Application
of	O
PEj	O
is	O
necessary	O
to	O
calculate	O
the	O
total	O
prefix	B-Application
sums	I-Application
in	O
the	O
right	O
subtree	O
(	O
e.g.	O
</s>
<s>
PEj	O
needs	O
to	O
include	O
the	O
total	O
prefix	B-Application
sum	I-Application
of	O
the	O
first	O
higher	O
order	O
node	O
which	O
is	O
reached	O
via	O
an	O
upward	O
path	O
including	O
a	O
right	O
children	O
connection	O
to	O
calculate	O
its	O
total	O
prefix	B-Application
sum	I-Application
.	O
</s>
<s>
Note	O
the	O
distinction	O
between	O
subtree-local	O
and	O
total	O
prefix	B-Application
sums	I-Application
.	O
</s>
<s>
Lower	O
level	O
PEs	O
might	O
require	O
the	O
total	O
prefix	B-Application
sum	I-Application
of	O
higher	O
level	O
PEs	O
to	O
calculate	O
their	O
total	O
prefix	B-Application
sum	I-Application
,	O
but	O
higher	O
level	O
PEs	O
only	O
require	O
subtree	O
local	O
prefix	B-Application
sums	I-Application
to	O
calculate	O
their	O
total	O
prefix	B-Application
sum	I-Application
.	O
</s>
<s>
The	O
root	O
node	O
as	O
highest	O
level	O
node	O
only	O
requires	O
the	O
local	O
prefix	B-Application
sum	I-Application
of	O
its	O
left	O
subtree	O
to	O
calculate	O
its	O
own	O
prefix	B-Application
sum	I-Application
.	O
</s>
<s>
Each	O
PE	O
on	O
the	O
path	O
from	O
PE0	O
to	O
the	O
root	O
PE	O
only	O
requires	O
the	O
local	O
prefix	B-Application
sum	I-Application
of	O
its	O
left	O
subtree	O
to	O
calculate	O
its	O
own	O
prefix	B-Application
sum	I-Application
,	O
whereas	O
every	O
node	O
on	O
the	O
path	O
from	O
PEp-1	O
(	O
last	O
PE	O
)	O
to	O
the	O
PEroot	O
requires	O
the	O
total	O
prefix	B-Application
sum	I-Application
of	O
its	O
parent	O
to	O
calculate	O
its	O
own	O
total	O
prefix	B-Application
sum	I-Application
.	O
</s>
<s>
Upward	O
PhasePropagate	O
the	O
subtree	O
local	O
prefix	B-Application
sum	I-Application
to	O
its	O
parent	O
for	O
each	O
PEj	O
.	O
</s>
<s>
Downward	O
phasePropagate	O
the	O
exclusive	O
(	O
exclusive	O
PEj	O
as	O
well	O
as	O
the	O
PEs	O
in	O
its	O
left	O
subtree	O
)	O
total	O
prefix	B-Application
sum	I-Application
of	O
all	O
lower	O
index	O
PEs	O
which	O
are	O
not	O
included	O
in	O
the	O
addressed	O
subtree	O
of	O
PEj	O
to	O
lower	O
level	O
PEs	O
in	O
the	O
left	O
child	O
subtree	O
of	O
PEj	O
.	O
</s>
<s>
Propagate	O
the	O
inclusive	O
prefix	B-Application
sum	I-Application
to	O
the	O
right	O
child	O
subtree	O
of	O
PEj	O
.	O
</s>
<s>
If	O
the	O
message	O
of	O
length	O
can	O
be	O
divided	O
into	O
packets	O
and	O
the	O
operator	O
⨁	O
can	O
be	O
used	O
on	O
each	O
of	O
the	O
corresponding	O
message	O
packets	O
separately	O
,	O
pipelining	B-General_Concept
is	O
possible	O
.	O
</s>
<s>
If	O
the	O
algorithm	O
is	O
used	O
without	O
pipelining	B-General_Concept
,	O
there	O
are	O
always	O
only	O
two	O
levels	O
(	O
the	O
sending	O
PEs	O
and	O
the	O
receiving	O
PEs	O
)	O
of	O
the	O
binary	O
tree	O
at	O
work	O
while	O
all	O
other	O
PEs	O
are	O
waiting	O
.	O
</s>
<s>
Upon	O
division	O
into	O
k	O
packets	O
,	O
each	O
of	O
size	O
and	O
sending	O
them	O
separately	O
,	O
the	O
first	O
packet	O
still	O
needs	O
to	O
be	O
propagated	O
to	O
as	O
part	O
of	O
a	O
local	O
prefix	B-Application
sum	I-Application
and	O
this	O
will	O
occur	O
again	O
for	O
the	O
last	O
packet	O
if	O
.	O
</s>
<s>
This	O
structure	O
allows	O
both	O
the	O
lookup	O
of	O
any	O
individual	O
prefix	B-Application
sum	I-Application
value	O
and	O
the	O
modification	O
of	O
any	O
array	B-Data_Structure
value	O
in	O
logarithmic	O
time	O
per	O
operation	O
.	O
</s>
<s>
For	O
higher-dimensional	O
arrays	O
,	O
the	O
summed	B-Algorithm
area	I-Algorithm
table	I-Algorithm
provides	O
a	O
data	O
structure	O
based	O
on	O
prefix	B-Application
sums	I-Application
for	O
computing	O
sums	O
of	O
arbitrary	O
rectangular	O
subarrays	O
.	O
</s>
<s>
This	O
can	O
be	O
a	O
helpful	O
primitive	O
in	O
image	B-Algorithm
convolution	I-Algorithm
operations	O
.	O
</s>
<s>
Counting	B-Algorithm
sort	I-Algorithm
is	O
an	O
integer	B-Algorithm
sorting	I-Algorithm
algorithm	O
that	O
uses	O
the	O
prefix	B-Application
sum	I-Application
of	O
a	O
histogram	B-Algorithm
of	O
key	O
frequencies	O
to	O
calculate	O
the	O
position	O
of	O
each	O
key	O
in	O
the	O
sorted	O
output	O
array	B-Data_Structure
.	O
</s>
<s>
It	O
runs	O
in	O
linear	O
time	O
for	O
integer	O
keys	O
that	O
are	O
smaller	O
than	O
the	O
number	O
of	O
items	O
,	O
and	O
is	O
frequently	O
used	O
as	O
part	O
of	O
radix	B-Algorithm
sort	I-Algorithm
,	O
a	O
fast	O
algorithm	O
for	O
sorting	O
integers	O
that	O
are	O
less	O
restricted	O
in	O
magnitude	O
.	O
</s>
<s>
List	B-Operating_System
ranking	I-Operating_System
,	O
the	O
problem	O
of	O
transforming	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
into	O
an	O
array	B-Data_Structure
that	O
represents	O
the	O
same	O
sequence	O
of	O
items	O
,	O
can	O
be	O
viewed	O
as	O
computing	O
a	O
prefix	B-Application
sum	I-Application
on	O
the	O
sequence	O
1	O
,	O
1	O
,	O
1	O
,	O
...	O
and	O
then	O
mapping	O
each	O
item	O
to	O
the	O
array	B-Data_Structure
position	O
given	O
by	O
its	O
prefix	B-Application
sum	I-Application
value	O
;	O
by	O
combining	O
list	B-Operating_System
ranking	I-Operating_System
,	O
prefix	B-Application
sums	I-Application
,	O
and	O
Euler	O
tours	O
,	O
many	O
important	O
problems	O
on	O
trees	O
may	O
be	O
solved	O
by	O
efficient	O
parallel	B-Operating_System
algorithms	I-Operating_System
.	O
</s>
<s>
An	O
early	O
application	O
of	O
parallel	O
prefix	B-Application
sum	I-Application
algorithms	O
was	O
in	O
the	O
design	O
of	O
binary	O
adders	O
,	O
Boolean	O
circuits	O
that	O
can	O
add	O
two	O
-bit	O
binary	O
numbers	O
.	O
</s>
<s>
By	O
using	O
a	O
circuit	O
that	O
performs	O
the	O
operations	O
of	O
the	O
parallel	O
prefix	B-Application
sum	I-Application
algorithm	O
,	O
it	O
is	O
possible	O
to	O
design	O
an	O
adder	O
that	O
uses	O
logic	O
gates	O
and	O
time	O
steps	O
.	O
</s>
<s>
In	O
the	O
parallel	B-Operating_System
random	I-Operating_System
access	I-Operating_System
machine	I-Operating_System
model	O
of	O
computing	O
,	O
prefix	B-Application
sums	I-Application
can	O
be	O
used	O
to	O
simulate	O
parallel	B-Operating_System
algorithms	I-Operating_System
that	O
assume	O
the	O
ability	O
for	O
multiple	O
processors	O
to	O
access	O
the	O
same	O
memory	O
cell	O
at	O
the	O
same	O
time	O
,	O
on	O
parallel	O
machines	O
that	O
forbid	O
simultaneous	O
access	O
.	O
</s>
<s>
By	O
means	O
of	O
a	O
sorting	B-Algorithm
network	I-Algorithm
,	O
a	O
set	O
of	O
parallel	O
memory	O
access	O
requests	O
can	O
be	O
ordered	O
into	O
a	O
sequence	O
such	O
that	O
accesses	O
to	O
the	O
same	O
cell	O
are	O
contiguous	O
within	O
the	O
sequence	O
;	O
scan	O
operations	O
can	O
then	O
be	O
used	O
to	O
determine	O
which	O
of	O
the	O
accesses	O
succeed	O
in	O
writing	O
to	O
their	O
requested	O
cells	O
,	O
and	O
to	O
distribute	O
the	O
results	O
of	O
memory	O
read	O
operations	O
to	O
multiple	O
processors	O
that	O
request	O
the	O
same	O
result	O
.	O
</s>
<s>
In	O
Guy	O
Blelloch	O
's	O
Ph.D.	O
thesis	O
,	O
parallel	O
prefix	O
operations	O
form	O
part	O
of	O
the	O
formalization	O
of	O
the	O
data	B-Operating_System
parallelism	I-Operating_System
model	O
provided	O
by	O
machines	O
such	O
as	O
the	B-Device
Connection	I-Device
Machine	I-Device
.	O
</s>
<s>
The	B-Device
Connection	I-Device
Machine	I-Device
CM-1	O
and	O
CM-2	O
provided	O
a	O
hypercubic	O
network	O
on	O
which	O
the	O
Algorithm	O
1	O
above	O
could	O
be	O
implemented	O
,	O
whereas	O
the	O
CM-5	B-Device
provided	O
a	O
dedicated	O
network	O
to	O
implement	O
Algorithm	O
2	O
.	O
</s>
<s>
In	O
the	O
construction	O
of	O
Gray	B-Device
codes	I-Device
,	O
sequences	O
of	O
binary	O
values	O
with	O
the	O
property	O
that	O
consecutive	O
sequence	O
values	O
differ	O
from	O
each	O
other	O
in	O
a	O
single	O
bit	O
position	O
,	O
a	O
number	O
can	O
be	O
converted	O
into	O
the	O
Gray	B-Device
code	I-Device
value	O
at	O
position	O
of	O
the	O
sequence	O
simply	O
by	O
taking	O
the	O
exclusive	O
or	O
of	O
and	O
(	O
the	O
number	O
formed	O
by	O
shifting	O
right	O
by	O
a	O
single	O
bit	O
position	O
)	O
.	O
</s>
<s>
The	O
reverse	O
operation	O
,	O
decoding	O
a	O
Gray-coded	O
value	O
into	O
a	O
binary	O
number	O
,	O
is	O
more	O
complicated	O
,	O
but	O
can	O
be	O
expressed	O
as	O
the	O
prefix	B-Application
sum	I-Application
of	O
the	O
bits	O
of	O
,	O
where	O
each	O
summation	O
operation	O
within	O
the	O
prefix	B-Application
sum	I-Application
is	O
performed	O
modulo	O
two	O
.	O
</s>
<s>
A	O
prefix	B-Application
sum	I-Application
of	O
this	O
type	O
may	O
be	O
performed	O
efficiently	O
using	O
the	O
bitwise	O
Boolean	O
operations	O
available	O
on	O
modern	O
computers	O
,	O
by	O
computing	O
the	O
exclusive	O
or	O
of	O
with	O
each	O
of	O
the	O
numbers	O
formed	O
by	O
shifting	O
to	O
the	O
left	O
by	O
a	O
number	O
of	O
bits	O
that	O
is	O
a	O
power	O
of	O
two	O
.	O
</s>
<s>
In	O
particular	O
,	O
it	O
can	O
be	O
used	O
to	O
compute	O
the	O
divided	B-Algorithm
difference	I-Algorithm
coefficients	O
of	O
the	O
Newton	O
form	O
of	O
the	O
interpolation	O
polynomial	O
.	O
</s>
<s>
as	O
well	O
as	O
for	O
parallel	B-Operating_System
algorithms	I-Operating_System
for	O
Vandermonde	O
systems	O
.	O
</s>
