CMakeLists.txt 1.2 KB
Newer Older
T
tensor-tang 已提交
1

2 3 4
set(jit_file ${PADDLE_BINARY_DIR}/paddle/fluid/operators/jit/kernels.h.tmp)
set(jit_file_final ${PADDLE_BINARY_DIR}/paddle/fluid/operators/jit/kernels.h)
file(WRITE  ${jit_file} "// Generated by the paddle/fluid/operators/jit/CMakeLists.txt.  DO NOT EDIT!\n\n")
T
tensor-tang 已提交
5 6 7
file(APPEND ${jit_file} "\#pragma once\n")
file(APPEND ${jit_file} "\#include \"paddle/fluid/operators/jit/helper.h\"\n")
file(APPEND ${jit_file} "\#include \"paddle/fluid/operators/jit/registry.h\"\n\n")
T
tensor-tang 已提交
8

9
set(JIT_KERNEL_DEPS cpu_info cblas gflags enforce place xxhash)
T
tensor-tang 已提交
10

T
tensor-tang 已提交
11
file(GLOB jit_kernel_cc_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cc")
T
tensor-tang 已提交
12
list(REMOVE_ITEM jit_kernel_cc_srcs test.cc benchmark.cc)
T
tensor-tang 已提交
13
cc_library(jit_kernel_base SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS})
T
tensor-tang 已提交
14

15
copy_if_different(${jit_file} ${jit_file_final})
16

T
tensor-tang 已提交
17
# refer must go first
T
tensor-tang 已提交
18
add_subdirectory(refer)
T
tensor-tang 已提交
19
add_subdirectory(more)
T
tensor-tang 已提交
20
if(WITH_XBYAK)
T
tensor-tang 已提交
21
    add_subdirectory(gen)
T
tensor-tang 已提交
22 23
endif()

24
cc_library(jit_kernel_helper INTERFACE SRCS ${jit_kernel_cc_srcs} DEPS jit_kernel_base ${JIT_KERNEL_DEPS})
T
tensor-tang 已提交
25
cc_test(jit_kernel_test SRCS test.cc DEPS jit_kernel_helper)
26
if(NOT WIN32)
T
tensor-tang 已提交
27
    cc_binary(jit_kernel_benchmark SRCS benchmark.cc DEPS jit_kernel_helper device_tracer tensor)
28
endif()