/floor_examples

example programs for https://github.com/a2flo/floor (dnn, nbody, warp, hlbvh, path tracer, other)

Primary LanguageC++

floor examples

dnn

  • demonstrates inference on a VGG16 deep neural network (implements convolution, max-pooling, fully-connected and softmax layers)

  • build with ./build.sh inside the folder

  • cd data/nets/vgg16 && ./get_vgg16.sh to download the necessary VGG16 layers/net

  • desktop/cli: run with --image <path/to/image.png> (image must be 224*224px 32-bit RGBA for now)

  • iOS: press cheese and take a photo iOS: Lake in the Alps; cli: Tiger, licensed under CC BY 2.0 by Tony Hisgett

warp

  • image-based warping, implemented using a scatter-based approach and a gather-based approach (based on "Image-Based Bidirectional Scene Reprojection")

  • also demonstrates use of: tessellation/displacement, argument buffers and indirect command pipelines

  • build with ./build.sh inside the folder

  • gather-based warping ref: Image-Based Bidirectional Scene Reprojection (original)

  • NOTE: in addition to floor + dependencies, this requires SDL2_image with libpng, as well as libwarp

  • video:
    0

nbody

  • N-body simulation to demonstrate local/shared memory buffers, local memory barriers, OpenGL and Metal buffer sharing, loop unrolling and that high performance computing is indeed possible with this toolchain

  • build with ./build.sh inside the folder

  • ref: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch31.html

  • video:
    0

hlbvh

path_tracer

  • a simple path tracer to demonstrate compute code compilation and execution, as well as some mildly complex modern C++ code

  • build with ./build.sh inside the folder

  • default output:
    noise and streaks courtesy of the horrible random function that I’m using

  • output with --with-textures:
    with simple textures

reduction

  • simple (WIP) reduction example that showcases 3 different reduce implementations: local/shared memory reduce, shuffle reduce and CUDA coop kernel + shuffle reduce

  • inclusive/exclusive scan test

  • build with ./build.sh inside the folder

img

  • small program to demonstrate image functionality by doing a gaussian blur, implemented as both a single-stage blur with manual local memory caching, as well as a separable horizontal/vertical "dumb" blur w/o manual caching (also: a GLSL/OpenGL implementation that does the same)

  • build with ./build.sh inside the folder

  • example output:
    image blur example

occ

  • offline-compute-compiler, compiles compute/graphics C++ code to CUDA/PTX, Metal/AIR, OpenCL/SPIR/SPIR-V, Vulkan/SPIR-V code/binaries (see --help for all options)

  • build with ./build.sh inside the folder

libfloor and toolchain