PixarAnimationStudios/OpenSubdiv — pull request #106 by aras-p (2013-02-03 08:23:56+00:00)
Title: Implement Apple GCD dispatcher

OpenMP is not available on OSX, which makes CPU cores sad. This implements a CPU dispatcher & kernels using Apple's GCD (Grand Central Dispatch). This might "just work" on iOS as well, since GCD is also available there, but I haven't checked.

On my 2 core (4 thread) MBP, this runs CPU kernels about 2x faster, which is roughly what I'd expect.

Notes:

* GCD is only compiled in on Apple systems. NO_GCD can be passed to CMake to exclude it.
* I've added GCD options to glViewer, but not to other viewers (yet?).
* I submit GCD work items in 32 item batch sizes; submitting one item per block is not faster due to dispatch overhead. So far I've only done this in ComputeFace, ComputeEdge, ComputeVertexA, ComputeVertexB kernels. Loop, bilinear and vertex edits dispatch one item at a time; will fix that later.
* Instead of duplicating the actual kernel code, I just call OsdCpu* functions.