[TF XLA AOT] Add cmake support for the standalone XLA AOT runtime

Example [generated Makefile](https://gist.github.com/mtrofin/fea40c80748d958b22a7ca655b52a730)

PiperOrigin-RevId: 299226330
Change-Id: Ia9969afefe3ac6d84b4eccbb93fdbd6f6341c955
This commit is contained in:
A. Unique TensorFlower 2020-03-05 16:38:02 -08:00 committed by TensorFlower Gardener
parent e0857cc6da
commit 06631493fd
4 changed files with 27 additions and 0 deletions

View File

@ -399,5 +399,6 @@ tensorflow/tools/pip_package/pip_smoke_test.py
tensorflow/tools/pip_package/setup.py
tensorflow/tools/pip_package/simple_console.py
tensorflow/tools/pip_package/simple_console_for_windows.py
tensorflow/tools/pip_package/xla_build/CMakeLists.txt
tensorflow/virtual_root_template_v1.__init__.py
tensorflow/virtual_root_template_v2.__init__.py

View File

@ -71,6 +71,11 @@ filegroup_as_file(
dep = "//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_srcs",
)
filegroup(
name = "xla_cmake",
srcs = ["xla_build/CMakeLists.txt"],
)
# Add dynamic kernel dso files here.
DYNAMIC_LOADED_KERNELS = [
"//tensorflow/core/kernels:libtfkernel_sobol_op.so",
@ -83,6 +88,7 @@ COMMON_PIP_DEPS = [
"setup.py",
":included_headers",
":xla_compiled_cpu_runtime_srcs.txt_file",
":xla_cmake",
"//tensorflow:tensorflow_py",
"//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_hdrs",
"//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_srcs",

View File

@ -69,6 +69,7 @@ function copy_xla_aot_runtime_sources() {
echo "Missing xla source file: ${file}" 1>&2
fi
done
cp tensorflow/tools/pip_package/xla_build/CMakeLists.txt "${dst_dir}"
popd
}

View File

@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.4.3)
file(GLOB_RECURSE TF_RUNTIME_SRC "*.cc")
add_library(tf_xla_runtime_objects OBJECT
${TF_RUNTIME_SRC}
)
target_include_directories(tf_xla_runtime_objects PRIVATE ../include)
target_compile_options(tf_xla_runtime_objects PRIVATE
-ftemplate-backtrace-limit=0
-Wno-ignored-attributes
-Wno-deprecated-copy
-Wno-cast-qual
-Wno-sign-compare
)
add_library(tf_xla_runtime STATIC
$<TARGET_OBJECTS:tf_xla_runtime_objects>
)