Loading src/TNL/Math.h +16 −6 Original line number Diff line number Diff line Loading @@ -27,6 +27,10 @@ template< typename T1, typename T2, typename ResultType = typename std::common_t __cuda_callable__ inline ResultType min( const T1& a, const T2& b ) { #if __cplusplus >= 201402L // std::min is constexpr since C++14 so it can be reused directly return std::min( (ResultType) a, (ResultType) b ); #else #if defined(__CUDA_ARCH__) return ::min( (ResultType) a, (ResultType) b ); #elif defined(__MIC__) Loading @@ -34,6 +38,7 @@ ResultType min( const T1& a, const T2& b ) #else return std::min( (ResultType) a, (ResultType) b ); #endif #endif } Loading @@ -46,6 +51,10 @@ template< typename T1, typename T2, typename ResultType = typename std::common_t __cuda_callable__ ResultType max( const T1& a, const T2& b ) { #if __cplusplus >= 201402L // std::max is constexpr since C++14 so it can be reused directly return std::max( (ResultType) a, (ResultType) b ); #else #if defined(__CUDA_ARCH__) return ::max( (ResultType) a, (ResultType) b ); #elif defined(__MIC__) Loading @@ -53,6 +62,7 @@ ResultType max( const T1& a, const T2& b ) #else return std::max( (ResultType) a, (ResultType) b ); #endif #endif } /*** Loading Loading
src/TNL/Math.h +16 −6 Original line number Diff line number Diff line Loading @@ -27,6 +27,10 @@ template< typename T1, typename T2, typename ResultType = typename std::common_t __cuda_callable__ inline ResultType min( const T1& a, const T2& b ) { #if __cplusplus >= 201402L // std::min is constexpr since C++14 so it can be reused directly return std::min( (ResultType) a, (ResultType) b ); #else #if defined(__CUDA_ARCH__) return ::min( (ResultType) a, (ResultType) b ); #elif defined(__MIC__) Loading @@ -34,6 +38,7 @@ ResultType min( const T1& a, const T2& b ) #else return std::min( (ResultType) a, (ResultType) b ); #endif #endif } Loading @@ -46,6 +51,10 @@ template< typename T1, typename T2, typename ResultType = typename std::common_t __cuda_callable__ ResultType max( const T1& a, const T2& b ) { #if __cplusplus >= 201402L // std::max is constexpr since C++14 so it can be reused directly return std::max( (ResultType) a, (ResultType) b ); #else #if defined(__CUDA_ARCH__) return ::max( (ResultType) a, (ResultType) b ); #elif defined(__MIC__) Loading @@ -53,6 +62,7 @@ ResultType max( const T1& a, const T2& b ) #else return std::max( (ResultType) a, (ResultType) b ); #endif #endif } /*** Loading