From 791d0133cc0d2499a84dd94e898c18cbb58c899e Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Wed, 8 May 2024 17:11:54 +0200 Subject: [PATCH] Update type_traits.h. (#402) * Update type_traits.h. A regression was introduced in 2b80e29803d60f01701a67bc57ef06dacfe8af8b. In case of THRUST_DEVICE_SYSTEM_OMP build, the invoke_result_t is undefined due to missing #else branch. See e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1064730 * fix(detail/nv_target.h): include missing target macros when targetting a non-hip backend (i.e. openmp) This change causes the HIP system target.h to be included when targetting a device system that is not HIP or CUDA. --------- Co-authored-by: Nara Prasetya --- thrust/detail/nv_target.h | 4 ++++ thrust/detail/type_traits.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/thrust/detail/nv_target.h b/thrust/detail/nv_target.h index 1f93a096b..131ca720a 100644 --- a/thrust/detail/nv_target.h +++ b/thrust/detail/nv_target.h @@ -27,4 +27,8 @@ # include #elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA # include +#else +// When using a different backend, e.g. OpenMP, we still need to define the target. +// We can simply reuse the HIP targets for this. +# include #endif diff --git a/thrust/detail/type_traits.h b/thrust/detail/type_traits.h index 31493c80b..60410cb5d 100644 --- a/thrust/detail/type_traits.h +++ b/thrust/detail/type_traits.h @@ -731,6 +731,8 @@ using invoke_result_t = #else // 2017+ ::cuda::std::invoke_result_t; #endif +#else + std::invoke_result_t; #endif template