Refactored code to support bvh build with and without ISPC