Summary: This fixed #442 by declaring two math functions to be device-only.

Reviewed By: bottler

Differential Revision: D24896992

fbshipit-source-id: a15918d06d2a3e6ee5cf250fec7af5f2f50a6164
This commit is contained in:
Christoph Lassner 2020-11-11 14:05:07 -08:00 committed by Facebook GitHub Bot
parent 18ce14cd31
commit faed5405c8

View File

@ -87,7 +87,7 @@ IHD float3 operator*(const float& a, const float3& b) {
return b * a;
}
IHD float length(const float3& v) {
INLINE DEVICE float length(const float3& v) {
// TODO: benchmark what's faster.
return NORM3DF(v.x, v.y, v.z);
// return __fsqrt_rn(v.x * v.x + v.y * v.y + v.z * v.z);
@ -107,7 +107,7 @@ IHD float3 rotate(
dir_z.x * v.x + dir_z.y * v.y + dir_z.z * v.z);
}
IHD float3 normalize(const float3& v) {
INLINE DEVICE float3 normalize(const float3& v) {
return v * RNORM3DF(v.x, v.y, v.z);
}