[PATCH] D92684: [CUDA, tet-suite] enable testing with C++17 and C++20
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 4 13:12:21 PST 2020
tra created this revision.
tra added a reviewer: jlebar.
Herald added subscribers: bixia, yaxunl, mgorny.
tra requested review of this revision.
Also disable the tests for 3-argument hypot() provided by the standard library
since c++17 as CUDA does not provide it.
Repository:
rT test-suite
https://reviews.llvm.org/D92684
Files:
External/CUDA/CMakeLists.txt
External/CUDA/cmath.cu
Index: External/CUDA/cmath.cu
===================================================================
--- External/CUDA/cmath.cu
+++ 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), "");
Index: External/CUDA/CMakeLists.txt
===================================================================
--- External/CUDA/CMakeLists.txt
+++ 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})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92684.309632.patch
Type: text/x-patch
Size: 1595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201204/497d5def/attachment.bin>
More information about the llvm-commits
mailing list