Hide menu


Multicore and GPU programming

Information page for the CPU and GPU lab work and lessons

Lab Series

Please register for the labs via webreg by friday 9/11. Webreg will be opened at course start.

Presence in lab sessions is mandatory.

Lab deadlines

CPU-labs (Labs 1, 2, 3): 29 nov 2018 (soft deadline), 20 dec 2018 18:00 (hard deadline)
GPU-labs (Labs 4, 5, 6): last lab session (19/20 dec 2018)


Lab rules and suggestions

Notice: Using GDB for debugging in Signal&Bild

For GDB to work, open .bashrc and add the following line:

export SHELL=/bin/sh

(This only needs to be done once, but any open terminals need to be restarted for it to apply)

Getting started with tools used in laboratories

Lab0: Introduction to C and the pthread API

A quick introduction by example to C syntax, data type and their use, functions, modules, as well as spawning and waiting for threads. Find another introduction from lab00 of the course "Concurrent programming and Operating Systems" (TDDB68), which include more C-related issues such as pointer management. Lab2 of TDDC78 (http://www.ida.liu.se/~chrke/tddb78/ also provides an introductory work to pthreads.

[source files]

Lab work

[Helper function for computing time spans]

Lab1: The Mandelbrot set and load balancing

Parallelize a generator of visual representation of the Mandelbrot set, fractals, observe load-balancing issues and implement a solution to them.

[source files] (Last updated 2018-11-12)

[instructions] (Last updated 2018-11-12)



Lab2: Non-blocking stack

Implement and measure the performance of a non-blocking, Treiber stack

[source files] (Last updated 2018-11-16)

[instructions] (Last updated 2018-11-15)


Lab3: High-level parallel programming

Try out high-level parallel programming with the data-parallel SkePU skeleton programming framework. Use the skeletons to implement image filters, including a median blur filter.

[source files] (Last updated 2018-11-16)


[SkePU user guide]

[slides] (Last updated 2018-11-20)

Lab 4: CUDA 1

lab material

Lab 5: CUDA 2

lab material

Lab 6: OpenCL / Shader programming

lab material

Page responsible: Christoph W Kessler
Last updated: 2018-11-21