forked from bartvdbraak/blender
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.
This commit is contained in:
parent
1f1dcdfd76
commit
cd6129d1ff
@ -17,6 +17,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* So ImathMath is included before our kernel_cpu_compat. */
|
||||
#ifdef WITH_OSL
|
||||
# include <OSL/oslexec.h>
|
||||
#endif
|
||||
|
||||
#include "device.h"
|
||||
#include "device_intern.h"
|
||||
|
||||
|
@ -25,6 +25,13 @@
|
||||
#include "util_half.h"
|
||||
#include "util_types.h"
|
||||
|
||||
/* On 64bit linux single precision exponent is really slow comparing to the
|
||||
* double precision version, even with float<->double conversion involved.
|
||||
*/
|
||||
#if !defined(__KERNEL_GPU__) && defined(__linux__) && defined(__x86_64__)
|
||||
# define expf(x) ((float)exp((double)x))
|
||||
#endif
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Assertions inside the kernel only work for the CPU device, so we wrap it in
|
||||
|
Loading…
Reference in New Issue
Block a user