[PATCH] D24428: [test-suite] Check that we can use std::shared_future from CUDA host code.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 14:45:12 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL281101: [test-suite] Check that we can use std::shared_future from CUDA host code. (authored by jlebar).
Changed prior to commit:
https://reviews.llvm.org/D24428?vs=70902&id=70913#toc
Repository:
rL LLVM
https://reviews.llvm.org/D24428
Files:
test-suite/trunk/External/CUDA/CMakeLists.txt
test-suite/trunk/External/CUDA/future.cu
Index: test-suite/trunk/External/CUDA/future.cu
===================================================================
--- test-suite/trunk/External/CUDA/future.cu
+++ test-suite/trunk/External/CUDA/future.cu
@@ -0,0 +1,21 @@
+// Make sure that we can compile CUDA files that include <future> and use
+// std::shared_future.
+//
+// At one point in time this didn't work because clang defined different values
+// for __GCC_ATOMIC_INT_LOCK_FREE on host and device. This caused libstdc++
+// not to define std::shared_future when compiling for device, resulting in
+// compile errors (even though we only use std::shared_future in host code).
+
+#if __cplusplus >= 201103L
+#include <future>
+
+void foo() {
+ std::shared_future<int> x;
+}
+#else
+#warning Skipping test because not compiled in C++11 mode.
+#endif
+
+int main() {
+ return 0;
+}
Index: test-suite/trunk/External/CUDA/CMakeLists.txt
===================================================================
--- test-suite/trunk/External/CUDA/CMakeLists.txt
+++ test-suite/trunk/External/CUDA/CMakeLists.txt
@@ -46,6 +46,7 @@
macro(create_local_cuda_tests VariantSuffix)
create_one_local_test(axpy axpy.cu)
create_one_local_test(empty empty.cu)
+ create_one_local_test(future future.cu)
endmacro()
macro(thrust_make_test_name TestName TestSourcePath)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24428.70913.patch
Type: text/x-patch
Size: 1321 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160909/2d72ec2a/attachment.bin>
More information about the llvm-commits
mailing list