ILGPU Tutorials

Primers (How a GPU works)

This series introduces how a GPU works and what ILGPU does. If you have programmed with CUDA or OpenCL before you can probably skip 01 and 02.

00 Setting up ILGPU (ILGPU version 1.0.0)

01 A GPU is not a CPU (ILGPU version 1.0.0)

This page will provide a quick rundown the basics of how kernels (think GPU programs) run.

02 Memory and bandwidth and threads. Oh my!

This will hopefully give you a better understanding of how memory works in hardware and the performance implications.

Beginner (How ILGPU works)

This series is meant to be a brief overview of ILGPU and how to use it. It assumes you have at least a little knowledge of how Cuda or OpenCL work. If you need a primer look to something like this for Cuda or this for OpenCL

01 Context and Accelerators

This tutorial covers creating the Context and Accelerator objects which setup ILGPU for use. It’s mostly boiler plate and does no computation but it does print info about your GPU if you have one. There is some advice about ILGPU in here that makes it worth the quick read.

See Also:

Device Info Sample

02 MemoryBuffers and ArrayViews

This tutorial covers the basics for Host / Device memory management.

See Also:

Simple Allocation Sample

03 Kernels and Simple Programs

This is where it all comes together. This covers actual code, on the actual GPU (or the CPU if you are testing / dont have a GPU).

See Also:

Simple Kernel Sample

Simple Math Sample

04 Structs and the N-body problem

This tutorial actually does something! We use computing the N-body problem as a sample of how to better manage Host / Device memory.

Beginner II (Something more interesting)

Well at least I think. This is where I will put ILGPUView bitmap shader things I (or other people if they want to) eventually write. Below are the few I have planned / think would be easy.

  1. Ray Tracing in One Weekend based raytracer
  2. Cloud Simulation
  3. 2D Physics Simulation
  4. Other things I see on shadertoy

Advanced Resources


They cover a wide swath of uses for ILGPU including much of the more complex things that ILGPU is capable of. There are too many to list out so I will just link to the repository.


Memory Buffers & Views


Shared Memory

Math Functions

Dynamically Specialized Kernels

Debugging & Profiling

Inside ILGPU

Upgrade Guides

Upgrade v0.1.X to v0.2.X

Upgrade v0.3.X to v0.5.X

Upgrade v0.6.X to v0.7.X

Upgrade v0.7.X to v0.8.X

Upgrade v0.8.0 to v0.8.1

Upgrade v0.8.X to v0.9.X

Help us make these docs great!

All ILGPU docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.