LordOfRings

LordOfRings

Finding rings in a sparse matrix, using the GPU.

The problem

In an almost empty matrix, where the value 1 draws rings, you need to work out the radius and centre of each ring and which ring each point belongs to. With many points, doing it naively is slow.

Rings found in a sparse matrix

What I built

  1. 01

    Circle fitting

    A semi-parallel Taubin algorithm to estimate the radius and centre of each ring.

  2. 02

    Telling rings apart

    Ptolemy's theorem on quadrilaterals inscribed in a circle is used to separate points belonging to different rings.

  3. 03

    GPU computation

    The module evaluates the radius and centre of each ring with GPU acceleration; a non-GPU version exists too.

  4. 04

    Documentation

    The project has documentation with tutorials.

  • My role

    University project developed in collaboration: the repository is published on the GitHub profile of Sara-a-r.

  • Technologies

    Python · CUDA · GPU · online documentation

Moving an algorithm to the GPU forces you to think about it differently, in parallel from the start. I learned to measure before optimising and to keep a simple reference version to compare results against.

What I learned

A slow numerical computation

Tell me the problem: it is often better to change the algorithm before the hardware.

Get in touch