Comparative Study of CPU and GPGPU Implementations of the Sievesof Eratosthenes, Sundaram and Atkin
2021 (engelsk)Independent thesis Advanced level (professional degree), 20 poäng / 30 hp
Oppgave
Abstract [en]
Background. Prime numbers are integers divisible only on 1 and themselves, and one of the oldest methods of finding them is through a process known as sieving. A prime number sieving algorithm produces every prime number in a span, usually from the number 2 up to a given number n. In this thesis, we will cover the three sieves of Eratosthenes, Sundaram, and Atkin.
Objectives. We shall compare their sequential CPU implementations to their parallel GPGPU (General Purpose Graphics Processing Unit) counterparts on the matter of performance, accuracy, and suitability. GPGPU is a method in which one utilizes hardware indented for graphics rendering to achieve a high degree of parallelism. Our goal is to establish if GPGPU sieving can be more effective than the sequential way, which is currently commonplace.
Method. We utilize the C++ and CUDA programming languages to implement the algorithms, and then extract data regarding their execution time and accuracy. Experiments are set up and run at several sieving limits, with the upper bound set by the memory capacity of available GPU hardware. Furthermore, we study each sieve to identify what characteristics make them fit or unfit for a GPGPU approach.
Results. Our results show that the sieve of Eratosthenes is slow and ill-suited for GPGPU computing, that the sieve of Sundaram is both efficient and fit for parallelization, and that the sieve of Atkin is the fastest but suffers from imperfect accuracy.
Conclusions. Finally, we address how the lesser concurrent memory capacity available for GPGPU limits the ranges that can be sieved, as compared to CPU. Utilizing the beneficial characteristics of the sieve of Sundaram, we propose a batch-divided implementation that would allow the GPGPU sieve to cover an equal range of numbers as any of the CPU variants.
sted, utgiver, år, opplag, sider
2021.
Emneord [en]
General Purpose Graphics Processing Unit, Parallelization, Prime number, Sieve.
HSV kategori
Identifikatorer
URN: urn:nbn:se:bth-21111OAI: oai:DiVA.org:bth-21111DiVA, id: diva2:1531686
Fag / kurs
Degree Project in Master of Science in Engineering 30,0 hp
Utdanningsprogram
PAACI Master of Science in Game and Software Engineering
Presentation
2021-01-26, Online, -, Karlskrona, 11:00 (engelsk)
Veileder
Examiner
2021-02-262021-02-262022-05-12bibliografisk kontrollert