Skip to content

Commit 1e16889

Browse files
author
Feiyu Chan
authored
fix compile error: only link dyload_cuda when cuda is available (#50)
* fix compile error: only link dyload_cuda when cuda is available
1 parent 0279d4a commit 1e16889

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ else()
9898
op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale)
9999
endif()
100100

101-
op_library(spectral_op SRCS spectral_op.cc spectral_op.cu DEPS dynload_cuda ${OP_HEADER_DEPS})
101+
if (WITH_GPU AND (NOT WITH_ROCM))
102+
op_library(spectral_op SRCS spectral_op.cc spectral_op.cu DEPS dynload_cuda ${OP_HEADER_DEPS})
103+
else()
104+
op_library(spectral_op SRCS spectral_op.cc DEPS ${OP_HEADER_DEPS})
105+
endif()
106+
102107
# op_library(spectral_op SRCS spectral_op.cc spectral_op.cu DEPS ${OP_HEADER_DEPS})
103108
# if (WITH_GPU)
104109
# find_library(CUFFT_LIB libcufft.so

0 commit comments

Comments
 (0)