CMakeLists.txt 975 Bytes
Newer Older
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
1 2
cmake_minimum_required(VERSION 3.16)

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
3 4
set(ENV{CUDACXX} /usr/local/cuda/bin/nvcc)

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
5
project(tf-gpu-feed LANGUAGES CXX CUDA)
fierval's avatar
fierval committed
6 7 8 9 10

cmake_policy(SET CMP0074 OLD)

set(CMAKE_CXX_STANDARD 11)

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
11
find_package(CUDA 10.0 REQUIRED)
fierval's avatar
fierval committed
12

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
13
set(SOURCE_FILES
fierval's avatar
fierval committed
14
    main.cpp
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
15 16
    dynlink_nvcuvid.cpp
    array.cu
fierval's avatar
fierval committed
17 18 19 20 21 22
    )

set(TENSORFLOW_LIBS libtensorflow_cc.so libtensorflow_framework.so)

link_directories("/usr/local/tensorflow/lib")

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
23 24
add_executable(tf-gpu-feed ${SOURCE_FILES})
set_target_properties(tf-gpu-feed PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
fierval's avatar
fierval committed
25

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
26
include_directories(${CUDA_INCLUDE_DIRS})
fierval's avatar
fierval committed
27 28 29 30 31 32

# TensorFlow headers
include_directories("/usr/local/tensorflow/include/tensorflow/")
include_directories("/usr/local/tensorflow/include/third-party/")
include_directories("/usr/local/tensorflow/include/")

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
33
target_link_libraries(tf-gpu-feed
fierval's avatar
fierval committed
34 35 36 37 38
    ${CUDA_LIBRARIES}
    cuda
    cublas
    nvinfer
    nvToolsExt
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
39 40 41
    nvparsers
    nvinfer_plugin
    nvonnxparser
fierval's avatar
fierval committed
42 43
    ${CMAKE_DL_LIBS}
    ${TENSORFLOW_LIBS})