<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="CUDA - Page 31 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=CUDA&amp;p=30">1.Previous</a><br />
<a accesskey="3" href="page.php?w=CUDA&amp;p=32">3.Next</a>
</p>

<p>__global__ void kernel(float* odata, int height, int width) {    unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;    unsigned int y = blockIdx.y*blockDim.y + threadIdx.y;    if (x < width && y < height) {        float c = tex2D(tex, x, y);        odata[y*width+x] = c;    }}</syntaxhighlight></></p>

<p>Below is an example given in <a href="page.php?w=Python_%28programming_language%29">Python</a> that computes the product of two arrays on the GPU. The unofficial Python language bindings can be obtained from PyCUDA.<syntaxhighlight lang="numpy">import numpyimport pycuda.autoinit</syntaxhighlight></p><p>
<a accesskey="1" href="page.php?w=CUDA&amp;p=30">1.Previous</a><br />
<a accesskey="3" href="page.php?w=CUDA&amp;p=32">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
