<s>
The	O
Brook	B-Library
programming	O
language	O
and	O
its	O
implementation	O
BrookGPU	B-Library
were	O
early	O
and	O
influential	O
attempts	O
to	O
enable	O
general-purpose	B-Architecture
computing	I-Architecture
on	I-Architecture
graphics	I-Architecture
processing	I-Architecture
units	I-Architecture
.	O
</s>
<s>
Brook	B-Library
,	O
developed	O
at	O
Stanford	O
University	O
graphics	O
group	O
,	O
was	O
a	O
compiler	O
and	O
runtime	O
implementation	O
of	O
a	O
stream	B-Application
programming	I-Application
language	O
targeting	O
modern	O
,	O
highly	O
parallel	O
GPUs	B-Architecture
such	O
as	O
those	O
found	O
on	O
ATI	O
or	O
Nvidia	O
graphics	O
cards	O
.	O
</s>
<s>
BrookGPU	B-Library
compiled	O
programs	O
written	O
using	O
the	O
Brook	B-Library
stream	B-Application
programming	I-Application
language	O
,	O
which	O
is	O
a	O
variant	O
of	O
ANSI	O
C	O
.	O
It	O
could	O
target	O
OpenGL	B-Application
v1.3	O
+	O
,	O
DirectX	B-Application
v9+	O
or	O
AMD	O
's	O
Close	O
to	O
Metal	O
for	O
the	O
computational	O
backend	O
and	O
ran	O
on	O
both	O
Microsoft	B-Application
Windows	I-Application
and	O
Linux	B-Application
.	O
</s>
<s>
For	O
debugging	O
,	O
BrookGPU	B-Library
could	O
also	O
simulate	B-Application
a	O
virtual	O
graphics	O
card	O
on	O
the	O
CPU	O
.	O
</s>
<s>
The	O
new	O
features	O
of	O
v0.5	O
include	O
a	O
much	O
upgraded	O
and	O
faster	O
OpenGL	B-Application
backend	O
which	O
uses	O
framebuffer	O
objects	O
instead	O
of	O
PBuffers	O
and	O
harmonised	O
the	O
code	O
around	O
standard	O
OpenGL	B-Application
interfaces	O
instead	O
of	O
using	O
proprietary	O
vendor	O
extensions	O
.	O
</s>
<s>
GLSL	B-Language
support	O
was	O
added	O
which	O
brings	O
all	O
the	O
functionality	O
(	O
complex	O
branching	O
and	O
loops	O
)	O
previously	O
only	O
supported	O
by	O
DirectX	B-Application
9	I-Application
to	O
OpenGL	B-Application
.	O
</s>
<s>
In	O
particular	O
,	O
this	O
means	O
that	O
Brook	B-Library
is	O
now	O
just	O
as	O
capable	O
on	O
Linux	B-Application
as	O
Windows	B-Application
.	O
</s>
<s>
Other	O
improvements	O
in	O
the	O
v0.5	O
series	O
include	O
multi-backend	O
usage	O
whereby	O
different	O
threads	O
can	O
run	O
different	O
Brook	B-Library
programs	O
concurrently	O
(	O
thus	O
maximising	O
use	O
of	O
a	O
multi-GPU	O
setup	O
)	O
and	O
SSE	B-General_Concept
and	O
OpenMP	B-Application
support	O
for	O
the	O
CPU	O
backend	O
(	O
this	O
allows	O
near	O
maximal	O
usage	O
of	O
modern	O
CPUs	O
)	O
.	O
</s>
<s>
A	O
like	O
for	O
like	O
comparison	O
between	O
desktop	O
CPUs	O
and	O
GPGPUs	B-Architecture
is	O
problematic	O
because	O
of	O
algorithmic	O
&	O
structural	O
differences	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
2.66GHz	O
Intel	O
Core	O
2	O
Duo	O
can	O
perform	O
a	O
maximum	O
of	O
25	O
GFLOPs	O
(	O
25	O
billion	O
single-precision	O
floating-point	O
operations	O
per	O
second	O
)	O
if	O
optimally	O
using	O
SSE	B-General_Concept
and	O
streaming	O
memory	O
access	O
so	O
the	O
prefetcher	O
works	O
perfectly	O
.	O
</s>
<s>
However	O
,	O
traditionally	O
(	O
due	O
to	O
shader	O
program	O
length	O
limits	O
)	O
most	O
GPGPU	B-Architecture
kernels	O
tend	O
to	O
perform	O
relatively	O
small	O
amounts	O
of	O
work	O
on	O
large	O
amounts	O
of	O
data	O
in	O
parallel	O
,	O
so	O
the	O
big	O
problem	O
with	O
directly	O
executing	O
GPGPU	B-Architecture
algorithms	O
on	O
desktop	O
CPUs	O
is	O
vastly	O
lower	O
memory	O
bandwidth	O
as	O
generally	O
speaking	O
the	O
CPU	O
spends	O
most	O
of	O
its	O
time	O
waiting	O
on	O
RAM	B-Architecture
.	O
</s>
<s>
As	O
an	O
example	O
,	O
dual-channel	O
PC2-6400	O
DDR2	O
RAM	B-Architecture
can	O
throughput	O
about	O
11Gbit/s	O
which	O
is	O
around	O
1.5	O
GFLOPs	O
maximum	O
given	O
that	O
there	O
is	O
a	O
total	O
of	O
3	O
GFLOPs	O
total	O
bandwidth	O
and	O
one	O
must	O
both	O
read	O
and	O
write	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
if	O
memory	O
bandwidth	O
constrained	O
,	O
Brook	B-Library
's	O
CPU	O
backend	O
wo	O
n't	O
exceed	O
2	O
GFLOPs	O
.	O
</s>
<s>
In	O
practice	O
,	O
it	O
's	O
even	O
lower	O
than	O
that	O
most	O
especially	O
for	O
anything	O
other	O
than	O
float4	O
which	O
is	O
the	O
only	O
data	O
type	O
which	O
can	O
be	O
SSE	B-General_Concept
accelerated	O
.	O
</s>
<s>
On	O
an	O
ATI	O
HD	O
2900	O
XT	O
(	O
740MHz	O
core	O
1000MHz	O
memory	O
)	O
,	O
Brook	B-Library
can	O
perform	O
a	O
maximum	O
of	O
410	O
GFLOPs	O
via	O
its	O
DirectX	B-Application
9	I-Application
backend	O
.	O
</s>
<s>
OpenGL	B-Application
is	O
currently	O
(	O
due	O
to	O
driver	O
and	O
Cg	B-Language
compiler	O
limitations	O
)	O
much	O
less	O
efficient	O
as	O
a	O
GPGPU	B-Architecture
backend	O
on	O
that	O
GPU	B-Architecture
,	O
so	O
Brook	B-Library
can	O
only	O
manage	O
210	O
GFLOPs	O
when	O
using	O
OpenGL	B-Application
on	O
that	O
GPU	B-Architecture
.	O
</s>
<s>
GPUs	B-Architecture
currently	O
have	O
major	O
branch	O
and	O
read/write	O
access	O
penalties	O
so	O
expect	O
a	O
reasonable	O
maximum	O
of	O
one	O
third	O
of	O
the	O
peak	O
maximum	O
in	O
real	O
world	O
code	O
-	O
this	O
still	O
leaves	O
that	O
ATI	O
card	O
at	O
around	O
125	O
GFLOPs	O
some	O
five	O
times	O
faster	O
than	O
the	O
Intel	O
Core	O
2	O
Duo	O
.	O
</s>
<s>
However	O
this	O
discounts	O
the	O
important	O
part	O
of	O
transferring	O
the	O
data	O
to	O
be	O
processed	O
to	O
and	O
from	O
the	O
GPU	B-Architecture
.	O
</s>
<s>
For	O
large	O
datasets	O
,	O
this	O
can	O
greatly	O
diminish	O
the	O
speed	O
increase	O
of	O
using	O
a	O
GPU	B-Architecture
over	O
a	O
well-tuned	O
CPU	O
implementation	O
.	O
</s>
<s>
Of	O
course	O
,	O
as	O
GPUs	B-Architecture
become	O
faster	O
far	O
more	O
quickly	O
than	O
CPUs	O
and	O
the	O
PCI	O
Express	O
interface	O
improves	O
,	O
it	O
will	O
make	O
more	O
sense	O
to	O
offload	O
large	O
processing	O
to	O
GPUs	B-Architecture
.	O
</s>
