Skip to content

Commit f44fb56

Browse files
authored
[flang-rt] Set CUDA_SEPARABLE_COMPILATION for PTX library. (#129563)
`CUDA_SEPARABLE_COMPILATION` adds `-rdc=true`, which is needed for the PTX library build.
1 parent 5bf1f03 commit f44fb56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flang-rt/cmake/modules/AddFlangRTOffload.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ macro(enable_cuda_compilation name files)
4747
# property can only be applied to object libraries and create *.ptx files
4848
# instead of *.o files. The .a will consist of those *.ptx files only.
4949
add_flangrt_library(obj.${name}PTX OBJECT ${files})
50-
set_property(TARGET obj.${name}PTX PROPERTY CUDA_PTX_COMPILATION ON)
50+
set_target_properties(obj.${name}PTX PROPERTIES
51+
CUDA_PTX_COMPILATION ON
52+
CUDA_SEPARABLE_COMPILATION ON
53+
)
5154
add_flangrt_library(${name}PTX STATIC "$<TARGET_OBJECTS:obj.${name}PTX>")
5255

5356
# Apply configuration options

0 commit comments

Comments
 (0)