Fixed missing EXPORT for Windows.
Merge branch 'master' into gpu_api_naming
Reorder code for clarity per code review.