Skip to content

Latest commit

 

History

History
 
 

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

gpu.cpp examples

This directory contains examples of how to use gpu.cpp.

Each example is a standalone project that can be built and run independently by running make from within the example directory.

Before running any of these examples, make sure you've downloaded the Dawn native webgpu installation binary by running make dawnlib from the root directory of the repository.

Basic Examples

Example Description
hello_world Minimal example to get started with gpu.cpp, implements a GELU neural network activation function.
gpu_puzzles Implementation of Sasha Rush's GPU puzzles.
shadertui An example of runtime live reloading of WGSL - demonstrated using a terminal shadertoy-like scii rendering.
render GPU ascii rendering of a signed distance function for two rotating 3D spheres.
physics Parallel physics simulation of a double pendulum with each thread starting at a different initial condition.

Advanced Examples

Example Description
float16 Hello World example using the float16 WebGPU extension, instead of the default float32.
matmul Tiled matrix multiplication.
transpose Tiled matrix transpose.