ORNL-CEES / DataTransferKit

A library for multiphysics solution transfer. ARCHIVED
https://datatransferkit.readthedocs.io/en/dtk-3.0/
BSD 3-Clause "New" or "Revised" License
47 stars 26 forks source link

Move KokkosExt::sgn to DTK #579

Closed masterleinad closed 4 years ago

masterleinad commented 4 years ago

https://github.com/arborx/ArborX/pull/350 removed KokkosExt::sgn from ArborX but we use it in DTK. Hence, just define it close to where we need it inside a Detail namespace.

dalg24 commented 4 years ago

DTK clang-format check failed

--- a/packages/Meshfree/src/DTK_DetailsSVDImpl.hpp
+++ b/packages/Meshfree/src/DTK_DetailsSVDImpl.hpp
@@ -29,9 +29,9 @@
  * @param x is zero, and -1 if @param x is less than zero.
  */
 template <typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
-KOKKOS_INLINE_FUNCTION int sgn(T x)
+KOKKOS_INLINE_FUNCTION int sgn( T x )
 {
-  return (x > 0) - (x < 0);
+    return ( x > 0 ) - ( x < 0 );
 }

 // The original version of this functor was taken from Trilinos mini-tensor
masterleinad commented 4 years ago

DTK clang-format check failed

Fixed.