carpentries-incubator / lesson-gpu-programming

GPU Programming with Python and CUDA.
https://carpentries-incubator.github.io/lesson-gpu-programming/
Other
20 stars 12 forks source link

Compute prime numbers between 1 and 10000 using Python code. #19

Closed HannoSpreeuw closed 3 years ago

HannoSpreeuw commented 3 years ago

The exercise is to compute all prime numbers between 1 and 10000 on the CPU and GPU using Python code. Numba will compile it for the GPU.

Start off with Python code for finding all primes in a certain interval. You can find this code all over the web.

Time it. Add a jit(nopython=True) decorator and time again.

Use Numba's vectorize decorator for the GPU.

isazi commented 3 years ago

I just added some comments to the content.

isazi commented 3 years ago

I will merge it so we have everything written down for next week's pilot workshop. Work on the lesson itself will keep going in the future.