From 0e780a5efdeb41ebe57d9ce6de1c0315caf18b09 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 22 May 2016 18:04:32 +0200 Subject: [PATCH] - Use Cuda built-in function for abs function implementation with Cuda compiler --- glm/detail/func_common.inl | 11 +++++++++++ readme.md | 1 + 2 files changed, 12 insertions(+) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 5dbcb72a..08a82aae 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -29,6 +29,17 @@ namespace detail } }; + #if GLM_COMPILER & GLM_COMPILER_CUDA + template <> + struct compute_abs + { + GLM_FUNC_QUALIFIER static float call(float x) + { + return fabsf(x); + } + }; + #endif + template struct compute_abs { diff --git a/readme.md b/readme.md index 09d53a1f..645b45f0 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 - Improved OpenMP support detection for Clang, GCC, ICC and VC - Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493 +- Use Cuda built-in function for abs function implementation with Cuda compiler ##### Fixes: - Fixed GTX_extended_min_max filename typo #386