Skip to content

CUDA: Fix thread flags for compilation and device linking

Since !1634 (merged) we consider every link item during device linking. However, items that start in - may be host-specific link flags that nvcc will not understand during device linking. Filter such items using a white list. In particular, this allows -pthread to be used for host linking while not polluting the device link line.

Also teach FindThreads to wrap -pthreads in -Xcompiler for compilation through nvcc.

Update the test suite to cover use of pthreads with CUDA.

Fixes: #18008 (closed)
Topic-rename: cuda-thread-flags

Edited by Brad King

Merge request reports