summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly
Commit message (Collapse)AuthorAgeFilesLines
* CUDA: Add test for device linking when host linking uses threadsRobert Maynard2018-10-243-99/+0
| | | | | | | | | Convert the `CudaOnly.LinkSystemDeviceLibraries` test to a new `Cuda.ProperDeviceLibraries` test. The former covered only the `cublas_device` library which is removed by CUDA 10. Extend the new test to also cover various cases of using threads. Issue: #18008
* Tests: Fix Cuda test project namesBrad King2018-10-109-9/+9
| | | | | Make them match what `ADD_TEST_MACRO` gives to ctest as the project name to build so that the `.sln` file will be found.
* Merge topic 'cuda-no-cublas_device'Brad King2018-08-241-0/+6
|\ | | | | | | | | | | | | 122c79748c CUDA: Avoid using deprecated cublas_device to identify device lib dirs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2296
| * CUDA: Avoid using deprecated cublas_device to identify device lib dirsRobert Maynard2018-08-231-0/+6
| | | | | | | | | | | | | | Use `curand_static` to identify directories containing device libraries because `cublas_device` is deprecated and will be removed in the future. Issue: #18290
* | CUDA: Properly de-duplicate libs when doing device linkingRobert Maynard2018-07-171-2/+1
| | | | | | | | | | | | | | | | The nvcc device linker is designed so that each static library with device symbols only needs to be listed once as it doesn't care about link order. If you provide the same static library multiple times it will error out. To make sure this occurs we find the unique set of link items.
* | CUDA: Add a test to verify device linking can handle circular depsRobert Maynard2018-07-176-0/+61
|/
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-013-18/+18
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* VS: Add workaround for CUDA compiler PDB locationBrad King2018-04-134-0/+37
| | | | | | | | | The CUDA Toolkit Visual Studio Integration does not honor the `ClCompile.ProgramDataBaseFileName` field when telling `nvcc` how to invoke `cl`. Work around this problem by passing `-Xcompiler=-Fd...` ourselves through `AdditionalOptions`. Fixes: #17647
* CUDA: Pass more link libraries to device linkingRobert Maynard2018-03-283-0/+93
| | | | | | | | | | | | | | | | | Previously we dropped non-target items from the device link line because nvcc rejects paths to shared library files, and only with target items do we know the kind of library. However, this also prevents projects from linking to system-provided libraries like `cublas_device` that contain device code. Fix this by passing more link items to device linking. Items that are not file paths, such as `-lfoo`, can simply be passed unconditionally. Items that are targets known to be shared libraries can still be skipped. Items that are paths to library files can be passed directly if they end in `.a`. Otherwise, pass them using `-Xnvlink` to bypass nvcc's front-end. The nvlink tool knows to ignore shared library files. Issue: #16317
* Tests: Add missing error check in CudaOnly.GPUDebugFlagBrad King2018-02-011-0/+5
| | | | If `cudaMallocManaged` fails then later use of `has_debug` is not valid.
* Merge topic 'msvc_cuda_8_explicitly_specify_cuda_language'Brad King2018-01-182-9/+2
|\ | | | | | | | | | | | | 46abfedb CUDA: MSVC will now state files are cuda files when needed Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1658
| * CUDA: MSVC will now state files are cuda files when neededRobert Maynard2018-01-122-9/+2
| | | | | | | | | | | | | | | | The MSVC CUDA build customizations before CUDA 9 would not explicitly add the -x cu option when building. This caused .cpp and .c files invoked with CudaCompile to be compiled as host code and not cuda. Now when we detect CUDA < 9 we will explicitly add this option to correct this bug.
* | Merge topic 'extend-compile-language-genex'Brad King2018-01-163-8/+33
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 506fda1c Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and Xcode c2f79c98 Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode 0795d25b cmVisualStudio10TargetGenerator: Factor out include dir computation 1ab4d186 cmLocalVisualStudio7Generator: Clarify variable name of compiled language 07e1a743 cmLocalVisualStudio7Generator: Clarify condition for target that compiles Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1657
| * Genex: Enable COMPILE_LANGUAGE for INCLUDE_DIRECTORIES with VS and XcodeBrad King2018-01-123-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The set of compile flags used for a target's C and C++ sources is based on the linker language. By default this is always the C++ flags if any C++ sources appear in the target, and otherwise the C flags. Therefore we can define the `COMPILE_LANGUAGE` generator expression in `INCLUDE_DIRECTORIES` to match the selected language. This is not exactly the same as for other generators, but is the best VS and Xcode can do. It is also sufficient for many use cases since the set of include directories for C and C++ is frequently similar but may be distinct from those for other languages like CUDA. Fixes: #17435
| * Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and XcodeBrad King2018-01-122-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The set of compile flags used for a target's C and C++ sources is based on the linker language. By default this is always the C++ flags if any C++ sources appear in the target, and otherwise the C flags. Therefore we can define the `COMPILE_LANGUAGE` generator expression in `COMPILE_DEFINITIONS` to match the selected language. This is not exactly the same as for other generators, but is the best VS and Xcode can do. It is also sufficient for many use cases since the set of definitions for C and C++ is frequently similar but may be distinct from those for other languages like CUDA. Issue: #17435
* | Merge topic 'cuda_allow_G_to_device_debugging_on_msvc'Brad King2018-01-123-1/+91
|\ \ | |/ |/| | | | | | | | | dcc606ad CUDA: Allow -G to control device debuging on MSVC. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1619
| * CUDA: Allow -G to control device debuging on MSVC.Robert Maynard2018-01-113-1/+91
| | | | | | | | Fixes #17551
* | CUDA: gencode signature that list multiple code types now supported.Robert Maynard2018-01-102-2/+3
|/ | | | Fixes #17263
* Cuda: ResolveDeviceSymbols now properly execute everywhere.Robert Maynard2017-12-132-15/+10
| | | | | | | | | The previous version had two bugs that caused the JIT runtime errors. 1. It was building the executable without separable compilation enabled 2. All kernel launches will fail if any kernel is missing a symbol, that is why the call to file2_launch_kernel had to be removed
* Merge topic 'extend-compile-language-genex'Brad King2017-11-272-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | 2ae880fa Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio 2b7d59f3 Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio 0f6f7c8a Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode c5a82d0f Tests: Decouple COMPILE_LANGUAGE in file(GENERATE) from COMPILE_OPTIONS 25773650 Tests: Remove unnecessary result files from RunCMake.File_Generate Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Jason Juang <jasjuang@gmail.com> Merge-request: !1511
| * Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual StudioBrad King2017-11-202-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.9.0-rc4~3^2~1 (VS: Fix target_compile_options for CUDA, 2017-06-21), the evaluation of `COMPILE_LANGUAGE` receives the proper language. The set of compile flags used for a target's C and C++ sources is based on the linker language. By default this is always the C++ flags if any C++ sources appear in the target, and otherwise the C flags. Therefore we can define the `COMPILE_LANGUAGE` generator expression in `COMPILE_OPTIONS` to match the selected language. This is not exactly the same as for other generators, but is the best VS can do. It is also sufficient for many use cases since the set of allowed flags for C and C++ is almost the same in Visual Studio. Furthermore, since the VS generator moves many of the flags to declarative `.vcxproj` elements, it will automatically avoid passing C++ flags for C sources. Issue: #17435
* | CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variableBrad King2017-11-171-0/+6
|/ | | | | | | Use its value to initialize the `CUDA_SEPARABLE_COMPILATION` target property when targets are created. Fixes: #17478
* Tests: Fix CudaOnly.WithDefs test on CUDA 9Brad King2017-09-291-1/+5
| | | | CUDA 9 dropped support for `compute_20`, so use a different alternative.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-9/+0
|
* Merge topic 'vs-cuda-fix-flags'Brad King2017-06-271-0/+5
|\ | | | | | | | | | | | | bbc1f364 VS: Fix support for nvcc flags not in our flag table Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1007
| * VS: Fix support for nvcc flags not in our flag tableBrad King2017-06-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit v3.9.0-rc4~3^2 (VS: Improve workaround for CUDA -Xcompiler placement bug, 2017-06-21) accidentally appended to the `AdditionalOptions` as if it were a `;`-separated list, but it is actually a command-line string. Append with a space instead. While at it, fix the same problem for the `AdditionalOptions` added to `CudaLink` by commit v3.9.0-rc3~1^2 (CUDA: When linking device code suppress CUDA 8.0+ deprecation warnings, 2017-06-09). Fixes: #17008
* | Merge topic 'vs-cuda-fix-flags'Brad King2017-06-223-0/+9
|\ \ | |/ | | | | | | | | | | | | 3b754215 VS: Improve workaround for CUDA -Xcompiler placement bug f2059585 VS: Fix target_compile_options for CUDA Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !996
| * VS: Improve workaround for CUDA -Xcompiler placement bugBrad King2017-06-211-0/+4
| | | | | | | | | | | | | | | | | | | | In commit v3.9.0-rc1~431^2~6 (VS: Place CUDA host compiler options in proper project file fields, 2017-03-07) we worked around a bug in the CUDA VS integration by dropping `AdditionalCompilerOptions`. However, this silently drops `-Xcompiler=` options given by the user that don't map to one of CudaCompile's dedicated settings. Improve the workaround to instead put the remaining `AdditionalCompilerOptions` into the `AdditionalOptions` field behind `-Xcompiler=` ourselves.
| * VS: Fix target_compile_options for CUDABrad King2017-06-212-0/+5
| | | | | | | | | | | | | | | | | | Fix the VS generator to honor `COMPILE_OPTIONS` for CUDA. The exclusion added by commit v3.9.0-rc1~431^2~7 (VS: Do not pass CUDA compile options to C compiler, 2017-03-07) was correct but we need additional logic to pass the CUDA compile options to the CUDA compiler. Also we should still pass the CXX or C options to MSVC (ClCompile) when those languages are enabled even if the link language is CUDA.
* | Tests: Simplify CUDA rpath on macOSBrad King2017-06-214-14/+10
|/ | | | | Use the `BUILD_RPATH` property and reference the CMake-computed location of the runtime libraries.
* CUDA: Static libraries can now explicitly resolve device symbolsRobert Maynard2017-04-268-0/+204
| | | | | | | If a static library has the property CUDA_RESOLVE_DEVICE_SYMBOLS enabled it will now perform the device link step. The normal behavior is to delay calling device link until the static library is consumed by a shared library or an executable.
* CUDA: Visual Studio now properly delays device linkingRobert Maynard2017-04-262-7/+73
|
* CUDA: Allow sources to be compiled to .ptx filesRobert Maynard2017-04-206-0/+145
| | | | | When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT libraries will generate ptx files instead of object files.
* CUDA: Work around VS limitation in CudaOnly.WithDefs testBrad King2017-03-102-2/+10
| | | | | | CUDA 8.0 MSBuild rules do not pass `-x cu` to nvcc and so cannot support a custom file extension. Fix our test for this to use a `.cu` extension instead.
* CUDA: Fix spelling of CudaOnly.SeparateCompilation test targetsBrad King2017-03-071-8/+8
|
* CUDA: Fix test cases to not override CUDA flagsBrad King2017-02-152-2/+2
| | | | Append to `CMAKE_CUDA_FLAGS` instead of overwriting it.
* Tests: Run clang-format on CUDA codeBrad King2017-02-148-50/+33
|
* clang-format.bash: Format CUDA source files tooBrad King2017-02-141-0/+9
| | | | | | Add `.clang-format` configuration files for Cuda test directories that use `Standard: Cpp11`. Otherwise clang-format splits the triple angle brackets used for CUDA kernels.
* CUDA: Detect the toolkit include directoriesRobert Maynard2017-02-101-0/+11
| | | | | The `nvcc -v` output provides what include directories need to be added to use the CUDA toolkit from other languages ( C/C++ ).
* CUDA: Enable CudaOnly.SeparateCompilation test runtime callsBrad King2017-01-121-4/+4
| | | | Uncomment the calls in `main.cpp` (and fix the signatures).
* CUDA: Port test cases to Windows with MSVC host compilerBrad King2017-01-124-3/+32
|
* CUDA: Tests now state why they are failing when no CUDA card is found.Robert Maynard2016-12-151-0/+1
|
* CUDA: Add tests to verify CUDA compiler works properly.Robert Maynard2016-11-1416-0/+301