Commit faed5405 authored by Christoph Lassner's avatar Christoph Lassner Committed by Facebook GitHub Bot
Browse files

Fix #442.

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

Reviewed By: bottler

Differential Revision: D24896992

fbshipit-source-id: a15918d06d2a3e6ee5cf250fec7af5f2f50a6164
parent 18ce14cd
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment