bvh
bvh copied to clipboard
Make OpenMP optional
OpenMP requires separate redistributable for MSVC, an option to remove the dependency or use C++11 threads would be appreciated (even at the cost of slower BVH building).
I may do this in the future, and in fact I have been thinking about it for some time. However, some people already use OpenMP/TBB/<insert your parallel programming library here>
(I myself use OpenMP in my renderer), and thus shipping yet another thread pool implementation along with this library is not a very good idea. Thus, making this work without OpenMP means I have to design my own generic interface to OpenMP/TBB/<other library>
, which is obviously harder than just using std::thread
.
Note that OpenMP is simply disabled for MSVC so you shouldn't have any problem building this on Windows, and there should not be any added dependency on the generated executables. The traversal algorithms are in any case not parallelized (it's the user's responsibility to choose how to do that), only the construction algorithms benefit from OpenMP.
Re-reading your question again, it seems that you just want to disable OpenMP on Windows, which should already be the case (since OpenMP 3.0 is not supported there). Could you clarify your issue? Or did you mean something else?
Sorry, just catching up. Yeah, ideally would prefer a custom threadpool in C++11 since this is more portable, but if OpenMP gets disabled I guess it can be good enough. We are still evaluating alternatives, but if we end up going with this library we may pull request this implementation ourselves.
The v2 branch now incorporates a custom thread pool based on std::thread
.