Git Product home page Git Product logo

gpu-palindromic-prime's Introduction

GPU-accelerated palindromic primes generator

CUDA program which uses sieve of Eratosthenes in order to find prime numbers which are palindromes (e.g. 101, 11011).

Features

Program includes three versions of the generator:

  • GPU-accelerated sieve of Erastothenes
  • CPU version of Sieve of Eratosthenes
  • CPU classic version

Algorithms

Sieve of Eratosthenes

A popular, ancient algorithm of finding prime numbers within a given limit. It does so by marking all multiples of each prime number as non-prime and skips them.

Classic CPU algorithm

It's the simplest, naive solution one can ever find. It's based on a simple loop which checks N numbers in terms of divisibility and being palindromic.

Performance analysis

Note that the following time values may not be 100% accurate as they might have been influenced by other programs running on the test PC setup and they have been interpolated (rolling mean) in order to make the graphs more clear.

GPU vs CPU version of Sieve of Eratosthenes

GPU vs CPU sieve Comparison of GPU vs CPU speed. Y axis - seconds, X axis - search range
The comparison clearly shows the advantage of GPU parallel version over the CPU one. Although, as visible at the very beginning, for smaller search ranges CPU outperforms the GPU.

Smaller range of numbers

GPU vs CPU sieve start Initial fragment of the previous graph

CPU vs CPU classic (iterative) version

CPU classic vs CPU sieve It seems that performance-wise, CPU version of sieve of Eratosthenes outperforms classic algorithm.

Comparison of all 3 versions

Summary

gpu-palindromic-prime's People

Contributors

jakubochnik avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.