From 560cdcedcb8b433bf70e6369604b5bf38ec28d48 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 23 Apr 2019 10:22:12 -0700 Subject: [PATCH 1/7] Add export symbol to gl_delegate so we can destroy the delegate, name the library for compilation --- .bazelrc | 9 +++++++++ tensorflow/lite/delegates/gpu/BUILD | 4 +++- tensorflow/lite/delegates/gpu/gl_delegate.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index d4d7ad618679d4..ca85e6203dd906 100644 --- a/.bazelrc +++ b/.bazelrc @@ -10,6 +10,15 @@ build:android_arm64 --config=android build:android_arm64 --cpu=arm64-v8a build:android_arm64 --fat_apk_cpu=arm64-v8a +# This is required for the default Android emulators, right? +build:android_x86 --config=android +build:android_x86 --cpu=x86 +build:andorid_x86 --fat_apk_cpu=x86 +build:android_x86_64 --config=android +build:android_x86_64 --cpu=x86_64 +build:android_x86_64 --fat_apk_cpu=x86_64 + + # Sets the default Apple platform to macOS. build --apple_platform_type=macos diff --git a/tensorflow/lite/delegates/gpu/BUILD b/tensorflow/lite/delegates/gpu/BUILD index e43e938809107d..db94683d43b8f9 100644 --- a/tensorflow/lite/delegates/gpu/BUILD +++ b/tensorflow/lite/delegates/gpu/BUILD @@ -88,7 +88,9 @@ objc_library( # build -c opt --config android_arm64 --copt -Os --copt -DTFLITE_GPU_BINARY_RELEASE --copt -fvisibility=hidden --linkopt -s --strip always :libtflite_gpu_gl.so cc_binary( name = "libtflite_gpu_gl.so", - linkopts = select({ + linkopts = [ + "-Wl,-soname=libtflite_gpu_gl.so" + ] + select({ "//tensorflow:android": [ "-lEGL", "-lGLESv3", diff --git a/tensorflow/lite/delegates/gpu/gl_delegate.h b/tensorflow/lite/delegates/gpu/gl_delegate.h index 66fd0c18655a03..97441deebce32d 100644 --- a/tensorflow/lite/delegates/gpu/gl_delegate.h +++ b/tensorflow/lite/delegates/gpu/gl_delegate.h @@ -88,7 +88,7 @@ TFL_CAPI_EXPORT TfLiteDelegate* TfLiteGpuDelegateCreate( const TfLiteGpuDelegateOptions* options); // Destroys a delegate created with `TfLiteGpuDelegateCreate` call. -void TfLiteGpuDelegateDelete(TfLiteDelegate* delegate); +TFL_CAPI_EXPORT void TfLiteGpuDelegateDelete(TfLiteDelegate* delegate); // Binds GL shader storage object to an input or an output tensor in the // initialized delegate. Bound buffer should have sufficient storage to From 2f0654c2c13cb3234363141f6553c3f7afca4e5e Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 13 May 2019 13:28:47 -0700 Subject: [PATCH 2/7] Sorry, bad typo --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index ca85e6203dd906..f0f0d50d5b693d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -13,7 +13,7 @@ build:android_arm64 --fat_apk_cpu=arm64-v8a # This is required for the default Android emulators, right? build:android_x86 --config=android build:android_x86 --cpu=x86 -build:andorid_x86 --fat_apk_cpu=x86 +build:android_x86 --fat_apk_cpu=x86 build:android_x86_64 --config=android build:android_x86_64 --cpu=x86_64 build:android_x86_64 --fat_apk_cpu=x86_64 From 90cf8ff0b430164d2922ebe0bea51970db72790e Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 17 May 2019 14:02:02 -0700 Subject: [PATCH 3/7] Adding formatting changes --- .bazelrc | 1 - tensorflow/lite/delegates/gpu/BUILD | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index f0f0d50d5b693d..e48898a622c89c 100644 --- a/.bazelrc +++ b/.bazelrc @@ -18,7 +18,6 @@ build:android_x86_64 --config=android build:android_x86_64 --cpu=x86_64 build:android_x86_64 --fat_apk_cpu=x86_64 - # Sets the default Apple platform to macOS. build --apple_platform_type=macos diff --git a/tensorflow/lite/delegates/gpu/BUILD b/tensorflow/lite/delegates/gpu/BUILD index 78bd2857785545..cb70fde2fb7fba 100644 --- a/tensorflow/lite/delegates/gpu/BUILD +++ b/tensorflow/lite/delegates/gpu/BUILD @@ -90,11 +90,11 @@ cc_binary( name = "libtensorflowlite_gpu_gl.so", linkopts = [ "-Wl,-soname=libtensorflowlite_gpu_gl.so" - ] + select({ + ] + select({ "//tensorflow:android": [ "-lEGL", "-lGLESv3", - ], + ], "//conditions:default": [], }), linkshared = 1, From f05a6dcaad139a09731c2042514f71d1ec569b84 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 17 May 2019 14:05:53 -0700 Subject: [PATCH 4/7] Found extra tab spaces, formatting fix --- tensorflow/lite/delegates/gpu/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/lite/delegates/gpu/BUILD b/tensorflow/lite/delegates/gpu/BUILD index cb70fde2fb7fba..2f271eed8334c7 100644 --- a/tensorflow/lite/delegates/gpu/BUILD +++ b/tensorflow/lite/delegates/gpu/BUILD @@ -89,7 +89,7 @@ objc_library( cc_binary( name = "libtensorflowlite_gpu_gl.so", linkopts = [ - "-Wl,-soname=libtensorflowlite_gpu_gl.so" + "-Wl,-soname=libtensorflowlite_gpu_gl.so" ] + select({ "//tensorflow:android": [ "-lEGL", From d83c0b87765fad3a071094fc28aedb911be799b3 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 17 May 2019 15:42:14 -0700 Subject: [PATCH 5/7] Fixing indent --- tensorflow/lite/delegates/gpu/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/lite/delegates/gpu/BUILD b/tensorflow/lite/delegates/gpu/BUILD index 2f271eed8334c7..2872527e644ee8 100644 --- a/tensorflow/lite/delegates/gpu/BUILD +++ b/tensorflow/lite/delegates/gpu/BUILD @@ -94,7 +94,7 @@ cc_binary( "//tensorflow:android": [ "-lEGL", "-lGLESv3", - ], + ], "//conditions:default": [], }), linkshared = 1, From 32acfd810fca8c6eeecf8cf70d715d6cd29b764b Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 21 May 2019 09:43:03 -0700 Subject: [PATCH 6/7] Removing comment about Android Emulators --- .bazelrc | 2 -- 1 file changed, 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index e48898a622c89c..2988831d2ddb76 100644 --- a/.bazelrc +++ b/.bazelrc @@ -9,8 +9,6 @@ build:android_arm --fat_apk_cpu=armeabi-v7a build:android_arm64 --config=android build:android_arm64 --cpu=arm64-v8a build:android_arm64 --fat_apk_cpu=arm64-v8a - -# This is required for the default Android emulators, right? build:android_x86 --config=android build:android_x86 --cpu=x86 build:android_x86 --fat_apk_cpu=x86 From bbb437b258f504e503e2b50d264270716c122d79 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 28 May 2019 09:55:59 -0700 Subject: [PATCH 7/7] Adding trailing comma --- tensorflow/lite/delegates/gpu/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/lite/delegates/gpu/BUILD b/tensorflow/lite/delegates/gpu/BUILD index 2872527e644ee8..c65b0e5c454100 100644 --- a/tensorflow/lite/delegates/gpu/BUILD +++ b/tensorflow/lite/delegates/gpu/BUILD @@ -89,7 +89,7 @@ objc_library( cc_binary( name = "libtensorflowlite_gpu_gl.so", linkopts = [ - "-Wl,-soname=libtensorflowlite_gpu_gl.so" + "-Wl,-soname=libtensorflowlite_gpu_gl.so", ] + select({ "//tensorflow:android": [ "-lEGL",