mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 20:02:49 +08:00
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
This commit is contained in:
parent
18ce14cd31
commit
faed5405c8
@ -87,7 +87,7 @@ IHD float3 operator*(const float& a, const float3& b) {
|
|||||||
return b * a;
|
return b * a;
|
||||||
}
|
}
|
||||||
|
|
||||||
IHD float length(const float3& v) {
|
INLINE DEVICE float length(const float3& v) {
|
||||||
// TODO: benchmark what's faster.
|
// TODO: benchmark what's faster.
|
||||||
return NORM3DF(v.x, v.y, v.z);
|
return NORM3DF(v.x, v.y, v.z);
|
||||||
// return __fsqrt_rn(v.x * v.x + v.y * v.y + v.z * 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);
|
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);
|
return v * RNORM3DF(v.x, v.y, v.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user