Skip to content

connorsimms/tf-raytrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taskflow Raytracer

A simple, multithreaded adaptation of Peter Shirley's Ray Tracing in One Weekend using the Taskflow concurrency library.

I modified color.h and camera.h to use Taskflow's for_each_index algorithm.

Performance

I benchmarked the performance difference on my Apple Silicon M2 Macbook, using C++ std::chrono timers.

Results

Implementation Workers Execution Time Speedup
Sequential 1 ~19.6s 1.00x
Taskflow 8* ~4.5s 4.35x

*Taskflow defaults to the number of available threads.

Dependencies

  • C++20 compatible compiler
  • CMake
  • Taskflow
  • (Optional) Nix package manager, if you want to use the flake.nix

Building and Running

To build the multithreaded version:

cmake -B build -DUSE_TASKFLOW=ON
cmake --build build
./build/raytracer > image.ppm

For the sequential version:

cmake -B build -DUSE_TASKFLOW=OFF
cmake --build build
./build/raytracer > image.ppm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors