<s>
WebCL	B-Library
(	O
Web	O
Computing	O
Language	O
)	O
is	O
a	O
JavaScript	B-Language
binding	O
to	O
OpenCL	B-Application
for	O
heterogeneous	O
parallel	B-Operating_System
computing	I-Operating_System
within	O
any	O
compatible	O
web	B-Application
browser	I-Application
without	O
the	O
use	O
of	O
plug-ins	B-Application
,	O
first	O
announced	O
in	O
March	O
2011	O
.	O
</s>
<s>
It	O
is	O
developed	O
on	O
similar	O
grounds	O
as	O
OpenCL	B-Application
and	O
is	O
considered	O
as	O
a	O
browser	B-Application
version	O
of	O
the	O
latter	O
.	O
</s>
<s>
Primarily	O
,	O
WebCL	B-Library
allows	O
web	O
applications	O
to	O
actualize	O
speed	O
with	O
multi-core	O
CPUs	B-Device
and	O
GPUs	B-Architecture
.	O
</s>
<s>
With	O
the	O
growing	O
popularity	O
of	O
applications	O
that	O
need	O
parallel	B-Operating_System
processing	I-Operating_System
like	O
image	O
editing	O
,	O
augmented	B-General_Concept
reality	I-General_Concept
applications	O
and	O
sophisticated	O
gaming	O
,	O
it	O
has	O
become	O
more	O
important	O
to	O
improve	O
the	O
computational	O
speed	O
.	O
</s>
<s>
With	O
these	O
background	O
reasons	O
,	O
a	O
non-profit	O
Khronos	B-Library
Group	I-Library
designed	O
and	O
developed	O
WebCL	B-Library
,	O
which	O
is	O
a	O
Javascript	B-Language
binding	O
to	O
OpenCL	B-Application
with	O
a	O
portable	O
kernel	B-Operating_System
programming	O
,	O
enabling	O
parallel	B-Operating_System
computing	I-Operating_System
on	O
web	B-Application
browsers	I-Application
,	O
across	O
a	O
wide	O
range	O
of	O
devices	O
.	O
</s>
<s>
In	O
short	O
,	O
WebCL	B-Library
consists	O
of	O
two	O
parts	O
,	O
one	O
being	O
Kernel	B-Operating_System
programming	O
,	O
which	O
runs	O
on	O
the	O
processors	O
(	O
devices	O
)	O
and	O
the	O
other	O
being	O
JavaScript	B-Language
,	O
which	O
binds	O
the	O
web	O
application	O
to	O
OpenCL	B-Application
.	O
</s>
<s>
The	O
completed	O
and	O
ratified	O
specification	O
for	O
WebCL	B-Library
1.0	O
was	O
released	O
on	O
March	O
19	O
,	O
2014	O
.	O
</s>
<s>
Currently	O
,	O
no	O
browsers	B-Application
natively	O
support	O
WebCL	B-Library
.	O
</s>
<s>
However	O
,	O
non-native	O
add-ons	O
are	O
used	O
to	O
implement	O
WebCL	B-Library
.	O
</s>
<s>
For	O
example	O
,	O
Nokia	O
developed	O
a	O
WebCL	B-Library
extension	O
.	O
</s>
<s>
Mozilla	B-Operating_System
does	O
not	O
plan	O
to	O
implement	O
WebCL	B-Library
in	O
favor	O
of	O
WebGL	B-Library
Compute	B-Operating_System
Shaders	I-Operating_System
,	O
which	O
were	O
in	O
turn	O
scrapped	O
in	O
favor	O
of	O
WebGPU	B-Operating_System
.	O
</s>
<s>
The	O
basic	O
unit	O
of	O
a	O
parallel	B-Operating_System
program	I-Operating_System
is	O
kernel	B-Operating_System
.	O
</s>
<s>
A	O
kernel	B-Operating_System
is	O
any	O
parallelizable	O
task	O
used	O
to	O
perform	O
a	O
specific	O
job	O
.	O
</s>
<s>
More	O
often	O
functions	O
can	O
be	O
realized	O
as	O
kernels	B-Operating_System
.	O
</s>
<s>
A	O
program	O
can	O
be	O
composed	O
of	O
one	O
or	O
more	O
kernels	B-Operating_System
.	O
</s>
<s>
In	O
order	O
to	O
realize	O
a	O
kernel	B-Operating_System
,	O
it	O
is	O
essential	O
that	O
a	O
task	O
is	O
parallelizable	O
.	O
</s>
<s>
Data	B-Operating_System
dependencies	I-Operating_System
and	O
order	O
of	O
execution	O
play	O
a	O
vital	O
role	O
in	O
producing	O
efficient	O
parallelized	B-Operating_System
algorithms	O
.	O
</s>
<s>
A	O
simple	O
example	O
can	O
be	O
thought	O
of	O
the	O
case	O
of	O
loop	B-Operating_System
unrolling	I-Operating_System
performed	O
by	O
C	O
compilers	O
,	O
where	O
a	O
statement	O
like:can	O
be	O
unrolled	O
into:Above	O
statements	O
can	O
be	O
parallelized	B-Operating_System
and	O
can	O
be	O
made	O
to	O
run	O
simultaneously	O
.	O
</s>
<s>
A	O
kernel	B-Operating_System
follows	O
a	O
similar	O
approach	O
where	O
only	O
the	O
snapshot	O
of	O
the	O
ith	O
iteration	O
is	O
captured	O
inside	O
kernel	B-Operating_System
.	O
</s>
<s>
Let	O
's	O
rewrite	O
the	O
above	O
code	O
using	O
a	O
kernel:Running	O
a	O
WebCL	B-Library
application	O
involves	O
the	O
following	O
steps	O
:	O
</s>
<s>
WebCL	B-Library
,	O
being	O
a	O
JavaScript	B-Language
based	O
implementation	O
,	O
does	O
n't	O
return	O
an	O
error	O
code	O
when	O
errors	O
occur	O
.	O
</s>
<s>
Instead	O
,	O
it	O
throws	O
an	O
exception	O
such	O
as	O
OUT_OF_RESOURCES	O
,	O
OUT_OF_HOST_MEMORY	O
,	O
or	O
the	O
WebCL-specific	O
WEBCL_IMPLEMENTATION_FAILURE	O
.	O
</s>
<s>
WebCL	B-Library
,	O
being	O
an	O
open-ended	O
software	O
developed	O
for	O
web	O
applications	O
,	O
there	O
is	O
lot	O
of	O
scope	O
for	O
vulnerabilities	O
in	O
the	O
design	O
and	O
development	O
fields	O
too	O
.	O
</s>
<s>
This	O
forced	O
the	O
developers	O
working	O
on	O
WebCL	B-Library
to	O
give	O
security	O
the	O
utmost	O
importance	O
.	O
</s>
<s>
A	O
project	O
WebCL	B-Library
Validator	O
,	O
was	O
initiated	O
by	O
the	B-Library
Khronos	I-Library
Group	I-Library
(	O
developers	O
)	O
on	O
handling	O
this	O
vulnerability	O
.	O
</s>
<s>
WebCL	B-Library
ensures	O
that	O
this	O
does	O
n't	O
happen	O
by	O
initializing	O
all	O
the	O
buffers	O
,	O
variables	O
used	O
to	O
zero	O
before	O
it	O
runs	O
the	O
current	O
application	O
.	O
</s>
<s>
OpenCL	B-Application
1.2	O
has	O
an	O
extension	O
‘	O
cl_khr_initialize_memory’	O
,	O
which	O
enables	O
this	O
.	O
</s>
<s>
Denial	O
of	O
Service	O
:	O
The	O
most	O
common	O
attack	O
on	O
web	O
applications	O
cannot	O
be	O
totally	O
eliminated	O
by	O
WebCL	B-Library
or	O
the	O
browser	B-Application
.	O
</s>
<s>
OpenCL	B-Application
can	O
be	O
provided	O
with	O
watchdog	O
timers	O
and	O
pre-emptive	O
multitasking	O
,	O
which	O
can	O
be	O
used	O
by	O
WebCL	B-Library
in	O
order	O
to	O
detect	O
and	O
terminate	O
the	O
contexts	O
that	O
are	O
taking	O
too	O
long	O
or	O
consume	O
lot	O
of	O
resources	O
.	O
</s>
<s>
There	O
is	O
an	O
extension	O
of	O
OpenCL	B-Application
1.2	O
‘	O
cl_khr_terminate_context’	O
like	O
for	O
the	O
previous	O
one	O
,	O
which	O
enables	O
to	O
terminate	O
the	O
process	O
that	O
might	O
cause	O
a	O
denial	O
of	O
service	O
attack	O
.	O
</s>
