expected speedup Numba/CUDA versus Numpy
<p>I'm new to Numba and CUDA and have done measurements to compare cuda jitted functions to Numpy on a few basic examples. For example,</p>

<pre><code>@cuda.jit("void(float32[:])")
def gpu_computation(array):
    pos = cuda.grid(1)
    if pos &lt; array.size:
        array[pos] = array[pos] ** 2.6
</code></pre>

<p>compared to single threaded</p>

<pre><code>def cpu_computation(array):
    array = array ** 2.6
    return array
</code></pre>

<p>with </p>

<pre><code>n=1000000
array = np.linspace(0, 100, num=n, dtype=np.float32)
threads per block = 32 
blocks per grid = 31250 
</code></pre>

<p>I get about 3x speedup with the GPU. This is also what I get when performing matrix multiplication (both the basic and the smart versions found in the Numba documentation). Optimising with copying to/from device did not help.</p>

<p>Is this speedup expected? I expected an order of magnitude more. My machine: Mac OSX with GeForcce GTX 775M 2048 MB and CUDA 7.5.30.</p>

<p>Double precision arithmetic throughput of your GTX 775M is <a href="http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#arithmetic-instructions" rel="nofollow">1/24th of the single precision throughput</a>.
As Python does not have a single precision type, you need to use <a href="http://numba.pydata.org/numba-doc/dev/reference/types.html" rel="nofollow">Numba types</a> to explicitly mark your data as single precision.</p>

<p>Unfortunately there is no way to speed up double precision calculations other than using a different GPU (Tesla lineup or the original, now out-of-production GTX Titan).</p>

python cuda numba