Add c_api to Android/mobile builds
This change is a prerequisite for introducing C Ops and Kernels into Android and iOS builds. PiperOrigin-RevId: 236432247
This commit is contained in:
parent
f832595165
commit
f2d54e9490
@ -39,14 +39,19 @@ filegroup(
|
||||
"python_api.h",
|
||||
"*test*",
|
||||
],
|
||||
),
|
||||
) + [
|
||||
"//tensorflow/cc:srcs",
|
||||
"//tensorflow/core/distributed_runtime:server_lib.h",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
tf_cuda_library(
|
||||
name = "c_api_internal",
|
||||
srcs = ["c_api.h"],
|
||||
hdrs = ["c_api_internal.h"],
|
||||
hdrs = [
|
||||
"c_api.h",
|
||||
"c_api_internal.h",
|
||||
],
|
||||
visibility = [
|
||||
"//tensorflow:internal",
|
||||
"//tensorflow/c:__subpackages__",
|
||||
@ -68,7 +73,9 @@ tf_cuda_library(
|
||||
|
||||
tf_cuda_library(
|
||||
name = "c_api",
|
||||
hdrs = ["c_api.h"],
|
||||
hdrs = [
|
||||
"c_api.h",
|
||||
],
|
||||
copts = tf_copts(),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
@ -89,9 +96,7 @@ tf_cuda_library(
|
||||
"c_api.cc",
|
||||
"c_api_function.cc",
|
||||
],
|
||||
hdrs = [
|
||||
"c_api.h",
|
||||
],
|
||||
hdrs = ["c_api.h"],
|
||||
copts = tf_copts(),
|
||||
visibility = ["//tensorflow/c:__subpackages__"],
|
||||
deps = [":c_api_internal"] + select({
|
||||
|
@ -8,6 +8,19 @@ package(
|
||||
|
||||
licenses(["notice"]) # Apache 2.0
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = [
|
||||
"framework/gradients.h",
|
||||
"framework/ops.h",
|
||||
"framework/scope.h",
|
||||
"framework/scope_internal.h",
|
||||
"ops/array_ops.h",
|
||||
"ops/while_loop.h",
|
||||
"//tensorflow/cc/saved_model:loader.h",
|
||||
],
|
||||
)
|
||||
|
||||
load(
|
||||
"//tensorflow:tensorflow.bzl",
|
||||
"cc_library_with_android_deps",
|
||||
@ -606,16 +619,13 @@ tf_gen_op_wrappers_cc(
|
||||
visibility = ["//tensorflow:internal"],
|
||||
)
|
||||
|
||||
cc_library_with_android_deps(
|
||||
cc_library(
|
||||
name = "cc_op_gen_main",
|
||||
srcs = [
|
||||
"framework/cc_op_gen.cc",
|
||||
"framework/cc_op_gen.h",
|
||||
"framework/cc_op_gen_main.cc",
|
||||
],
|
||||
android_deps = [
|
||||
"//tensorflow/core:android_tensorflow_lib",
|
||||
],
|
||||
copts = tf_copts(),
|
||||
data = [
|
||||
"//tensorflow/core/api_def:base_api_def",
|
||||
|
@ -629,6 +629,9 @@ BENCHMARK_NAME := $(BINDIR)benchmark
|
||||
|
||||
CORE_CC_ALL_SRCS := \
|
||||
$(ABSL_CC_SRCS) \
|
||||
tensorflow/c/c_api.cc \
|
||||
tensorflow/c/kernels.cc \
|
||||
tensorflow/c/tf_status_helper.cc \
|
||||
$(wildcard tensorflow/core/*.cc) \
|
||||
$(wildcard tensorflow/core/common_runtime/*.cc) \
|
||||
$(wildcard tensorflow/core/framework/*.cc) \
|
||||
|
@ -1671,6 +1671,7 @@ filegroup(
|
||||
":protos_all_proto_text_srcs",
|
||||
":error_codes_proto_text_srcs",
|
||||
"//tensorflow/core/platform/default/build_config:android_srcs",
|
||||
"//tensorflow/c:srcs",
|
||||
] + glob(
|
||||
[
|
||||
"client/**/*.cc",
|
||||
|
@ -33,13 +33,12 @@ tf_cuda_library(
|
||||
"//tensorflow:android": [],
|
||||
"//conditions:default": ["."],
|
||||
}),
|
||||
deps = [
|
||||
"//tensorflow/c:c_api",
|
||||
] + select({
|
||||
deps = select({
|
||||
"//tensorflow:android": [
|
||||
"//tensorflow/core:android_tensorflow_lib",
|
||||
],
|
||||
"//conditions:default": [
|
||||
"//tensorflow/c:c_api",
|
||||
"//tensorflow/core:all_kernels",
|
||||
"//tensorflow/core:direct_session",
|
||||
"//tensorflow/core:ops",
|
||||
|
Loading…
Reference in New Issue
Block a user