diff --git a/include/fused_kernel/core/constexpr_libs/constexpr_cmath.h b/include/fused_kernel/core/constexpr_libs/constexpr_cmath.h index 766fb984..365822d7 100644 --- a/include/fused_kernel/core/constexpr_libs/constexpr_cmath.h +++ b/include/fused_kernel/core/constexpr_libs/constexpr_cmath.h @@ -53,11 +53,18 @@ using cuda::std::max; using cuda::std::min; #else // Polyfill for CUDA < 13.3 where is missing -template constexpr __host__ __device__ const T &max(const T &a, const T &b) { return (a < b) ? b : a; } +template +FK_HOST_DEVICE_CNST T max(const T a, const T b) { + return (a < b) ? b : a; +} -template constexpr __host__ __device__ const T &min(const T &a, const T &b) { return (b < a) ? b : a; } +template +FK_HOST_DEVICE_CNST T min(const T a, const T b) { + return (b < a) ? b : a; +} -template constexpr __host__ __device__ const T &clamp(const T &v, const T &lo, const T &hi) { +template +FK_HOST_DEVICE_CNST T clamp(const T v, const T lo, const T hi) { return (v < lo) ? lo : ((hi < v) ? hi : v); } #endif