Cycles / CUDA: Change inline rules for BVH intersection functions.

* On sm_30 and above there is no change (was not inlined already before), this just fixes a speed regression from yesterday. 6359c36ba407
* On sm_2x (tested with sm_21), I get a nice 8% speedup in the bmw scene with this. As a bonus, cubin compilation time and memory usage is significantly reduced. Regular cubin size went from 2.5MB to 2.0MB, Experimental one from 3.8MB to 2.5MB.
Cycles / CUDA: Workaround to make sm_52 (Maxwell) cards work.

* sm_52 can run a sm_50 kernel, so tell runtime detection to use that until we build a dedicated sm_52 kernel.
BLI_buffer: simplify buffer resize
Cycles: Fix for debug kernel not working with CUDA
Cycles: Make OpenCL folks happy to use __KERNEL_DEBUG__

Quite straightforward change, the only annoying thing is that we can't use
indentation for include directive just because of the way headers inlineing
works for OpenCL.

Might do smarter job in path_source_replace_includes() but don't want to
spend time on this yet.
OSX/Ghost: little code cleanup
Cleanup: sculpt float -> bool
Fix tgz script (included all files in submodules)
Cycles: __KERNEL_DEBUG__ wasn't set for compile-time kernels
Cycles: Forgot to set WITH_CYCLES_DEBUG for OSL kernel
Fix T42081, OpenCL supports float3 since the 1.1 specification, not sure why we needed this.
Cycles: Center Tile order had a slight offset to the left.

Signed-off-by: Thomas Dinges
Fix T41983: Array Modifier "Merge" bug?

We messed up previous fix, in 'simplified' translated merge case... :(
Quiet warning on 32bit system
Fix T42093: segfault when trying to free unallocated depths zbuffer (border-zoom in 3DView).

Thanks to jensverwiebe (jens verwiebe) for investigations too!
Dyntopo: minor speedup collapsing edges
Cleanup: remove paranoid NULL checks
Cycles: Move system headers include to the top of the files

This is a good practice to do anyway, plus it'll help with the upcoming change.
Cycles: Workaround dead-slow expf() on 64bit linux

Single precision exponent on 64bit linux tends to be order of magnitude slower
than double precision version even with single<->double precision conversion.

Some feedback in the mailing lists also suggests that logf() is also slow, but
this i didn't confirm here in the studio yet.

Depending on the shader setup it gives ~3% with the secret agent shot and up to
around 15% with the bmw scene here.
Cycles: Fix for viewport rendering with debug enabled