Skip to content

Commit 3ddc997

Browse files
committed
rename concat_functor to concat, refine CMakeLists based on comments
1 parent 1ef97fa commit 3ddc997

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ op_library(save_op DEPS lod_tensor)
201201
op_library(load_op DEPS lod_tensor)
202202
op_library(save_combine_op DEPS lod_tensor)
203203
op_library(load_combine_op DEPS lod_tensor)
204-
op_library(concat_op DEPS concat_functor)
204+
op_library(concat_op DEPS concat)
205205

206206
list(REMOVE_ITEM GENERAL_OPS ${DEPS_OPS})
207207
foreach(src ${GENERAL_OPS})

paddle/fluid/operators/math/CMakeLists.txt

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ function(math_library TARGET)
66
# But it handle split GPU/CPU code and link some common library.
77
set(cc_srcs)
88
set(cu_srcs)
9-
set(math_common_deps device_context framework_proto)
10-
set(multiValueArgs SRCS DEPS)
9+
set(math_common_deps device_context)
10+
set(multiValueArgs DEPS)
1111
cmake_parse_arguments(math_library "${options}" "${oneValueArgs}"
1212
"${multiValueArgs}" ${ARGN})
1313

@@ -18,36 +18,34 @@ function(math_library TARGET)
1818
list(APPEND cu_srcs ${TARGET}.cu)
1919
endif()
2020

21+
list(LENGTH cc_srcs cc_srcs_len)
2122
if (WITH_GPU)
2223
nv_library(${TARGET} SRCS ${cc_srcs} ${cu_srcs} DEPS ${math_library_DEPS} ${math_common_deps})
23-
else()
24+
elseif(${cc_srcs_len} GREATER 0)
2425
cc_library(${TARGET} SRCS ${cc_srcs} DEPS ${math_library_DEPS} ${math_common_deps})
2526
endif()
2627
endfunction()
2728

28-
math_library(math_function DEPS cblas)
29-
math_library(im2col)
30-
math_library(selected_rows_functor DEPS selected_rows)
31-
math_library(softmax)
29+
# please add new math_library in alphabetical order
30+
math_library(concat)
31+
math_library(context_project DEPS im2col math_function)
3232
math_library(cross_entropy)
33+
math_library(cos_sim_functor)
34+
math_library(depthwise_conv)
35+
math_library(gru_compute DEPS activation_functions math_function)
36+
math_library(im2col)
37+
math_library(lstm_compute DEPS activation_functions)
38+
math_library(math_function DEPS cblas framework_proto)
39+
math_library(maxouting)
3340
math_library(pooling)
34-
math_library(sequence_pooling)
35-
math_library(vol2col)
36-
math_library(context_project)
41+
math_library(selected_rows_functor DEPS selected_rows)
3742
math_library(sequence2batch)
3843
math_library(sequence_padding)
44+
math_library(sequence_pooling DEPS math_function)
3945
math_library(sequence_scale)
40-
math_library(maxouting)
46+
math_library(softmax)
4147
math_library(unpooling)
42-
math_library(cos_sim_functor)
43-
math_library(lstm_compute DEPS activation_functions)
44-
math_library(gru_compute DEPS activation_functions)
45-
if(WITH_GPU)
46-
nv_library(depthwise_conv SRCS depthwise_conv.cu DEPS device_context)
47-
nv_library(concat_functor SRCS concat.cc concat.cu DEPS device_context tensor)
48-
else()
49-
cc_library(concat_functor SRCS concat.cc DEPS device_context tensor)
50-
endif()
48+
math_library(vol2col)
5149

5250
cc_test(math_function_test SRCS math_function_test.cc)
5351
cc_test(selected_rows_functor_test SRCS selected_rows_functor_test.cc DEPS selected_rows_functor)
@@ -58,4 +56,4 @@ if(WITH_GPU)
5856
nv_test(math_function_gpu_test SRCS math_function_test.cu)
5957
nv_test(selected_rows_functor_gpu_test SRCS selected_rows_functor_test.cu DEPS selected_rows_functor)
6058
endif()
61-
cc_test(concat_test SRCS concat_test.cc DEPS concat_functor tensor)
59+
cc_test(concat_test SRCS concat_test.cc DEPS concat)

paddle/fluid/operators/math/sequence2batch.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#include "paddle/fluid/operators/math/sequence2batch.h"
16-
#include "paddle/fluid/operators/math/math_function.h"
1716

1817
namespace paddle {
1918
namespace operators {

0 commit comments

Comments
 (0)