You are in: Home » Teaching » APAI 2020-2021

Architectures and Platforms for Artificial Intelligence (2nd module)
Department of Computer Science and Engineering, University of Bologna, 2020/2021

[ News | About the course | Final exam | Teaching material]


The lecture on monday november 9 is rescheduled at 2pm—4:30pm; the lecture will be held online and will be recorded as usual. Apologies for the late notice.
The lecture scheduled on monday, november 2nd is cancelled. All future lectures of module 2 (prof. Marzolla) will be held online only. Sorry for the inconvenience.
Instructions on how to get an account on the server are available on
There are issues accessing the server that will be used for OpenMP/CUDA programming. New instructions will be available soon.
Page created.

About the course

This is the Web page of the Architectures and platforms for Artificial Intelligence (2nd module) for the second cycle degree in Artificial Intelligence, University of Bologna.

Multi- and many-core processors, once found on expensive supercomputers, are now ubiquitous; however, parallel programming paradigms must be used to benefit from the processing power of multi- and many-core processors, but those paradigms are little known to the majority of programmers. In this module we introduce the basic techniques for programming shared-memory multi-core processors (CPUs) and graphics processing units (GPUs). For the former we will use OpenMP/C, i.e., the OpenMP extensions to the C programming language. For the latter, we will introduce programming general-purpose graphics processing units (GPGPUs) using CUDA/C, a proprietary extension of the C programming language for GPGPU programming.


  1. Parallel architectures and Flynn's taxonomy
  2. Parallel programming patterns (embarassingly parallel, decomposition, scatter/gather, scan, reduce, ...)
  3. Shared-Memory programming with OpenMP
    • OpenMP programming model
    • The "omp parallel" costruct
    • Scoping costructs
    • Other work-sharing costructs
    • Some examples of applications
  4. GPU programming with CUDA
    • CUDA architecture and terminology
    • CUDA programming model
    • CUDA memory hierarchy
    • CUDA/C programming costructs
    • Some examples of applications


Online resources on C programming:

Tutorials on the Linux shell

Final exam

The final exam of this module consists of a programming project using OpenMP and/or CUDA. Depending on the number of students enrolled, the project might be assigned by the instructor or proposed by each student. The project must include a written report at most six pages long. The project can be handed in at any time during the academic year, up to september 2021 (when the new edition of this course will begin).

The final grade of the Architectures and Platforms for Artificial Intelligence course will be determined as the weighted average of the grades of modules 1+3 and module 2, rounded to the nearest integer. Honors (lode) will be awarded at the discretion of the instructors for outstanding exams.

Teaching material

Sample code

Sample code discussed during the lectures is available here.


[ODP] [PDF] [video]
Additional material
Parallel architectures
[ODP] [PDF] [video]
Per approfondire
Parallel Programming Patterns
[ODP] [PDF] [video]
Additional material
Shared-Memory Programming with OpenMP
[ODP] [PDF] [video]
[Instructions on how to get an account on the server are on]
Additional material
Shared-Memory Programming with OpenMP (cont.) [video]
Performance Evaluation of Parallel Programs
[ODP] [PDF] [video]
Per approfondire
CUDA Programming
[ODP] [PDF] [video]
CUDA Programming (cont.) [video]
CUDA Programming (cont.) [video]
Conclusions and wrap-up
This page validates as XHTML 1.0 strict This page validates as CSS Check the accessibility of this page with WAVE
This page was last updated on November 24 2020 informativa sulla privacy