Skip to content

Commit 91da934

Browse files
fix link question of CMake configuration for device module
1 parent a3c4184 commit 91da934

1 file changed

Lines changed: 40 additions & 39 deletions

File tree

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
1-
# list(APPEND module_device_srcs
2-
# memory_op.cpp
3-
# device.cpp
4-
# )
1+
list(APPEND module_device_srcs
2+
memory_op.cpp
3+
device.cpp
4+
)
55

6-
# if(USE_CUDA)
7-
# list(APPEND module_device_srcs
8-
# cuda/memory_op.cu
9-
# )
10-
# endif()
6+
if(USE_CUDA)
7+
list(APPEND module_device_srcs
8+
cuda/memory_op.cu
9+
)
10+
endif()
1111

12+
add_library(device OBJECT ${module_device_srcs})
1213

13-
# if(USE_ROCM)
14-
# hip_add_library(module_device_rocm STATIC
15-
# rocm/memory_op.hip.cu
16-
# )
17-
# target_link_libraries(
18-
# device
19-
# module_device_rocm
20-
# hip::host
21-
# hip::device
22-
# hip::hipfft
23-
# roc::hipblas
24-
# roc::hipsolver
25-
# )
26-
# endif()
14+
if(USE_ROCM)
15+
hip_add_library(module_device_rocm STATIC
16+
rocm/memory_op.hip.cu
17+
)
18+
target_link_libraries(
19+
device
20+
module_device_rocm
21+
hip::host
22+
hip::device
23+
hip::hipfft
24+
roc::hipblas
25+
roc::hipsolver
26+
)
27+
endif()
2728

28-
# add_library(device OBJECT ${device_srcs})
2929

30-
# if(USE_CUDA)
31-
# target_link_libraries(
32-
# device
33-
# )
34-
# elseif(USE_ROCM)
35-
# target_link_libraries(
36-
# device
37-
# device_rocm
38-
# hip::host
39-
# hip::device
40-
# hip::hipfft
41-
# roc::hipblas
42-
# roc::hipsolver
43-
# )
44-
# endif()
30+
31+
if(USE_CUDA)
32+
target_link_libraries(
33+
device
34+
)
35+
elseif(USE_ROCM)
36+
target_link_libraries(
37+
device
38+
device_rocm
39+
hip::host
40+
hip::device
41+
hip::hipfft
42+
roc::hipblas
43+
roc::hipsolver
44+
)
45+
endif()

0 commit comments

Comments
 (0)