Skip to content

Commit 3edd32d

Browse files
committed
fix(Compile): fix depends error when compile op using cub
some operators depend on cub and xxhash by header. The dependency should be declared explicitly rather than declared to pybind. test=develop
1 parent 1d9b2a4 commit 3edd32d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ if (WITH_GPU AND TENSORRT_FOUND)
3434
add_subdirectory(tensorrt)
3535
endif()
3636

37-
register_operators(EXCLUDES warpctc_op conv_fusion_op)
37+
SET(OP_HEADER_DEPS xxhash)
38+
if (WITH_GPU)
39+
SET(OP_HEADER_DEPS ${OP_HEADER_DEPS} cub)
40+
endif()
41+
42+
register_operators(EXCLUDES warpctc_op conv_fusion_op DEPS ${OP_HEADER_DEPS})
3843

3944
# warpctc_cudnn need cudnn 7 above
4045
if (WITH_GPU)
@@ -49,14 +54,14 @@ else()
4954
op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale)
5055
endif()
5156

52-
set(COMMON_OP_DEPS "")
57+
set(COMMON_OP_DEPS ${OP_HEADER_DEPS})
5358

54-
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} xxhash selected_rows_functor selected_rows lod_tensor maxouting unpooling pooling lod_rank_table context_project sequence_pooling executor dynload_warpctc sequence_padding sequence_scale cos_sim_functor memory jit_kernel concat_and_split cross_entropy softmax vol2col im2col sampler)
59+
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} selected_rows_functor selected_rows lod_tensor maxouting unpooling pooling lod_rank_table context_project sequence_pooling executor dynload_warpctc sequence_padding sequence_scale cos_sim_functor memory jit_kernel concat_and_split cross_entropy softmax vol2col im2col sampler)
5560
if (NOT WIN32)
5661
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} sequence2batch lstm_compute matrix_bit_code gru_compute activation_functions)
5762
endif()
5863
if (WITH_GPU)
59-
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} depthwise_conv cub)
64+
set(COMMON_OP_DEPS ${COMMON_OP_DEPS} depthwise_conv)
6065
endif()
6166

6267
# FIXME(typhoonzero): operator deps may not needed.

0 commit comments

Comments
 (0)