@@ -6,8 +6,8 @@ function(math_library TARGET)
6
6
# But it handle split GPU/CPU code and link some common library.
7
7
set (cc_srcs )
8
8
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 )
11
11
cmake_parse_arguments (math_library "${options} " "${oneValueArgs} "
12
12
"${multiValueArgs} " ${ARGN} )
13
13
@@ -18,36 +18,34 @@ function(math_library TARGET)
18
18
list (APPEND cu_srcs ${TARGET} .cu )
19
19
endif ()
20
20
21
+ list (LENGTH cc_srcs cc_srcs_len )
21
22
if (WITH_GPU )
22
23
nv_library (${TARGET} SRCS ${cc_srcs} ${cu_srcs} DEPS ${math_library_DEPS} ${math_common_deps} )
23
- else ( )
24
+ elseif ( ${cc_srcs_len} GREATER 0 )
24
25
cc_library (${TARGET} SRCS ${cc_srcs} DEPS ${math_library_DEPS} ${math_common_deps} )
25
26
endif ()
26
27
endfunction ()
27
28
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 )
32
32
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 )
33
40
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 )
37
42
math_library (sequence2batch )
38
43
math_library (sequence_padding )
44
+ math_library (sequence_pooling DEPS math_function )
39
45
math_library (sequence_scale )
40
- math_library (maxouting )
46
+ math_library (softmax )
41
47
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 )
51
49
52
50
cc_test (math_function_test SRCS math_function_test.cc )
53
51
cc_test (selected_rows_functor_test SRCS selected_rows_functor_test.cc DEPS selected_rows_functor )
@@ -58,4 +56,4 @@ if(WITH_GPU)
58
56
nv_test (math_function_gpu_test SRCS math_function_test.cu )
59
57
nv_test (selected_rows_functor_gpu_test SRCS selected_rows_functor_test.cu DEPS selected_rows_functor )
60
58
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 )
0 commit comments