Internal change

PiperOrigin-RevId: 515094293
This commit is contained in:
Sebastian Schmidt 2023-03-08 11:30:56 -08:00 committed by Copybara-Service
parent ddc535e705
commit 09f63cbbe0
2 changed files with 34 additions and 1 deletions

View File

@ -22,6 +22,7 @@ load(
load("//mediapipe/framework:mediapipe_cc_test.bzl", "mediapipe_cc_test")
load("//mediapipe/framework:encode_binary_proto.bzl", "encode_binary_proto")
load("@org_tensorflow//tensorflow/lite/core/shims:cc_library_with_tflite.bzl", "cc_library_with_tflite")
load("//mediapipe/framework:more_selects.bzl", "more_selects")
licenses(["notice"])
@ -35,6 +36,27 @@ exports_files(
],
)
config_setting(
name = "disable_gpu",
define_values = {
"MEDIAPIPE_DISABLE_GPU": "1",
},
visibility = ["//visibility:public"],
)
more_selects.config_setting_negation(
name = "not_disable_gpu",
negate = ":disable_gpu",
)
selects.config_setting_group(
name = "platform_ios_with_gpu",
match_all = [
":not_disable_gpu",
"//mediapipe:ios",
],
)
selects.config_setting_group(
name = "compute_shader_unavailable",
match_any = [
@ -585,7 +607,7 @@ cc_library(
":inference_calculator_cpu",
] + select({
"//conditions:default": [":inference_calculator_gl_if_compute_shader_available"],
"//mediapipe:ios": [":inference_calculator_metal"],
":platform_ios_with_gpu": [":inference_calculator_metal"],
}),
alwayslink = 1,
)

View File

@ -272,6 +272,14 @@ selects.config_setting_group(
],
)
selects.config_setting_group(
name = "platform_ios_without_gpu",
match_all = [
":disable_gpu",
"//mediapipe:ios",
],
)
selects.config_setting_group(
name = "platform_macos_with_gpu",
match_all = [
@ -310,6 +318,9 @@ cc_library(
":gl_texture_view",
":gl_texture_buffer",
],
":platform_ios_without_gpu": [
"//mediapipe/objc:util",
],
":disable_gpu": [],
}),
)