[CUDA, test-suite] enable testing with C++17 and C++20
Also disable the tests for 3-argument hypot() provided by the standard library
since c++17 as CUDA does not provide it.
Differential Revision: https://reviews.llvm.org/D92684
diff --git a/External/CUDA/CMakeLists.txt b/External/CUDA/CMakeLists.txt
index 743f72e..ebff585 100644
--- a/External/CUDA/CMakeLists.txt
+++ b/External/CUDA/CMakeLists.txt
@@ -189,7 +189,7 @@
create_local_cuda_tests(${VariantSuffix})
add_dependencies(cuda-tests-simple cuda-tests-simple-${VariantSuffix})
- if(DEFINED THRUST_PATH AND (NOT ${Std} STREQUAL "c++14"))
+ if(DEFINED THRUST_PATH AND (NOT ${Std} IN_LIST "c++14;c++17;c++20"))
create_thrust_tests(${VariantSuffix})
endif()
@@ -337,7 +337,7 @@
list(APPEND _Cuda_CPPFLAGS ${_CudaArchFlags})
set(_Cuda_Libs cudart-${_CudaVersion})
- foreach(_Std IN ITEMS "c++98" "c++11" "c++14")
+ foreach(_Std IN ITEMS "c++98" "c++11" "c++14" "c++17" "c++20")
set(_Std_Suffix "${_Std}")
set(_Std_CPPFLAGS -std=${_Std})
set(_Std_LDFLAGS -std=${_Std})
diff --git a/External/CUDA/cmath.cu b/External/CUDA/cmath.cu
index 365ecce..f6f2afc 100644
--- a/External/CUDA/cmath.cu
+++ b/External/CUDA/cmath.cu
@@ -1144,7 +1144,8 @@
assert(std::hypot(3.f, 4.) == 5);
assert(std::hypot(3.f, 4.f) == 5);
-#if __cplusplus >= 201703L && STDLIB_VERSION >= 2017
+ // CUDA does not provide 3-argument hypot().
+#if 0 // __cplusplus >= 201703L && STDLIB_VERSION >= 2017
static_assert((std::is_same<decltype(std::hypot((float)0, (float)0, (float)0)), float>::value), "");
static_assert((std::is_same<decltype(std::hypot((float)0, (bool)0, (float)0)), double>::value), "");
static_assert((std::is_same<decltype(std::hypot((float)0, (unsigned short)0, (double)0)), double>::value), "");