Commit 19c4c9ea authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Math.h: Added workaround for weird clang error

TODO: check later if it is really necessary
parent a804a923
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -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__)
@@ -34,6 +38,7 @@ ResultType min( const T1& a, const T2& b )
 #else
   return std::min( (ResultType) a, (ResultType) b );
 #endif
#endif
}


@@ -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__)
@@ -53,6 +62,7 @@ ResultType max( const T1& a, const T2& b )
 #else
   return std::max( (ResultType) a, (ResultType) b );
 #endif
#endif
}

/***