diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2016-11-01 20:11:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-14 21:40:50 (GMT) |
commit | 7b9131da64b4b569e10ec145fab0c8e22fa69761 (patch) | |
tree | bf3cf32fa6515c1d197e7950262094290b797e6e /Tests/CudaOnly/SeparateCompilation/file2.cu | |
parent | 9cf5b98d54497b425fe341e4ad5bc188d9fa5445 (diff) | |
download | CMake-7b9131da64b4b569e10ec145fab0c8e22fa69761.zip CMake-7b9131da64b4b569e10ec145fab0c8e22fa69761.tar.gz CMake-7b9131da64b4b569e10ec145fab0c8e22fa69761.tar.bz2 |
CUDA: Add tests to verify CUDA compiler works properly.
Diffstat (limited to 'Tests/CudaOnly/SeparateCompilation/file2.cu')
-rw-r--r-- | Tests/CudaOnly/SeparateCompilation/file2.cu | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CudaOnly/SeparateCompilation/file2.cu b/Tests/CudaOnly/SeparateCompilation/file2.cu new file mode 100644 index 0000000..6b8b06b --- /dev/null +++ b/Tests/CudaOnly/SeparateCompilation/file2.cu @@ -0,0 +1,20 @@ + +#include "file2.h" + +result_type __device__ file1_func(int x); + +result_type_dynamic __device__ file2_func(int x) +{ + if(x!=42) + { + const result_type r = file1_func(x); + const result_type_dynamic rd { r.input, r.sum, true }; + return rd; + } + else + { + const result_type_dynamic rd { x, x*x*x, false }; + return rd; + } + +} |