File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed
Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -688,6 +688,23 @@ class Steal {};
688688// / @brief Tag dispatch class that distinguishes constructors during file input
689689class PartialCreate {};
690690
691+ // For half compilation
692+ namespace math {
693+ template <>
694+ inline auto cwiseAdd (const math::Vec3<math::half>& v, const float s)
695+ {
696+ math::Vec3<math::half> out;
697+ const math::half* ip = v.asPointer ();
698+ math::half* op = out.asPointer ();
699+ for (unsigned i = 0 ; i < 3 ; ++i, ++op, ++ip) {
700+ OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
701+ *op = *ip + s;
702+ OPENVDB_NO_TYPE_CONVERSION_WARNING_END
703+ }
704+ return out;
705+ }
706+ } // namespace math
707+
691708} // namespace OPENVDB_VERSION_NAME
692709} // namespace openvdb
693710
Original file line number Diff line number Diff line change @@ -594,20 +594,6 @@ Abs(const Vec3<T>& v)
594594 return Vec3<T>(Abs (v[0 ]), Abs (v[1 ]), Abs (v[2 ]));
595595}
596596
597- template <>
598- inline auto cwiseAdd (const Vec3<math::internal::half>& v, const float s)
599- {
600- Vec3<math::internal::half> out;
601- const math::internal::half* ip = v.asPointer ();
602- math::internal::half* op = out.asPointer ();
603- for (unsigned i = 0 ; i < 3 ; ++i, ++op, ++ip) {
604- OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
605- *op = *ip + s;
606- OPENVDB_NO_TYPE_CONVERSION_WARNING_END
607- }
608- return out;
609- }
610-
611597// / Orthonormalize vectors v1, v2 and v3 and store back the resulting
612598// / basis e.g. Vec3d::orthonormalize(v1,v2,v3);
613599template <typename T>
You can’t perform that action at this time.
0 commit comments