AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.76k stars 438 forks source link

Leverage the new DeepMind three-element sorting algorithm #1805

Open doug-walker opened 1 year ago

doug-walker commented 1 year ago

A new AI generated sorting algorithm for 3, 4, and 5 element sequences claims up to a 70% performance improvement. We do a fair amount of stuff that is closely related to three element sorting in OCIO (tetrahedral interpolation, hue calculation, 3d-LUT inversion), so it would be interesting to see if we could leverage this. It should be available in the C++ standard library at some point, but we don't always use that.

https://www.deepmind.com/blog/alphadev-discovers-faster-sorting-algorithms

Code is available here. Wondering if it would be more compact using intrinsics? https://reviews.llvm.org/D118029