aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/cmake/tf_stream_executor.cmake
blob: 0bc8dad0ab7d61c6920cf94a805ae9aa687b5e04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#cc_library(
#    name = "stream_executor",
#    srcs = glob(
#        [
#XX            "*.cc",
#            "lib/*.cc",
#        ],
#        exclude = [
#            "**/*_test.cc",
#        ],
#    ) + if_cuda(
#        glob([
#            "cuda/*.cc",
#        ]),
#    ),
#    hdrs = glob([
#        "*.h",
#        "cuda/*.h",
#        "lib/*.h",
#        "platform/**/*.h",
#    ]),
#    data = [
#        "//tensorflow/core:cuda",
#        "//third_party/gpus/cuda:cublas",
#        "//third_party/gpus/cuda:cudnn",
#    ],
#    linkopts = [
#        "-ldl",
#    ],
#    visibility = ["//visibility:public"],
#    deps = [
#        "//tensorflow/core:lib",
#        "//third_party/gpus/cuda:cuda_headers",
#    ],
#    alwayslink = 1,
#)

########################################################
# tf_stream_executor library
########################################################
file(GLOB tf_stream_executor_srcs
    "${tensorflow_source_dir}/tensorflow/stream_executor/*.cc"
    "${tensorflow_source_dir}/tensorflow/stream_executor/*.h"
    "${tensorflow_source_dir}/tensorflow/stream_executor/lib/*.cc"
    "${tensorflow_source_dir}/tensorflow/stream_executor/lib/*.h"
    "${tensorflow_source_dir}/tensorflow/stream_executor/platform/*.h"
    "${tensorflow_source_dir}/tensorflow/stream_executor/platform/default/*.h"
)

#file(GLOB_RECURSE tf_stream_executor_test_srcs
#    "${tensorflow_source_dir}/tensorflow/stream_executor/*_test.cc"
#    "${tensorflow_source_dir}/tensorflow/stream_executor/*_test.h"
#)
#
#list(REMOVE_ITEM tf_stream_executor_srcs ${tf_stream_executor_test_srcs}) 

add_library(tf_stream_executor OBJECT ${tf_stream_executor_srcs})

target_include_directories(tf_stream_executor PRIVATE
    ${tensorflow_source_dir}
)
add_dependencies(tf_stream_executor
    tf_core_lib
)
#target_link_libraries(tf_stream_executor
#    ${CMAKE_THREAD_LIBS_INIT}
#    ${PROTOBUF_LIBRARIES}
#    tf_protos_cc
#    tf_core_lib
#)

target_compile_options(tf_stream_executor PRIVATE
    -fno-exceptions
    -DEIGEN_AVOID_STL_ARRAY
)

# C++11
target_compile_features(tf_stream_executor PRIVATE
    cxx_rvalue_references
)