TFLite iOS GPU: removed unused functions.

PiperOrigin-RevId: 277290047
Change-Id: I7995296f7dcfd1216dcc6fb496fb9198c18f4568
diff --git a/tensorflow/lite/delegates/gpu/metal/common.h b/tensorflow/lite/delegates/gpu/metal/common.h
index 6d5d4d2..9d7d661 100644
--- a/tensorflow/lite/delegates/gpu/metal/common.h
+++ b/tensorflow/lite/delegates/gpu/metal/common.h
@@ -29,12 +29,6 @@
 /// Returns system default device on iOS or Intel GPU on macOS.
 id<MTLDevice> GetBestSupportedMetalDevice();
 
-/// Returns version of the GPU that supports Metal.
-/// @param device Used as a parameter because mac can contain multiple devices.
-/// @discussion Refer to Apple docs for MTLFeatureSet_macOS_GPUFamily1_v1 for details.
-///     1 - Intel integrated GPU the only device that is supported
-int GetMacOsGpuVersion(id<MTLDevice> device);
-
 /// Metal compute shader compilation
 /// @param device The device on which that shader program will be stored.
 /// @param code Shader source.
diff --git a/tensorflow/lite/delegates/gpu/metal/common.mm b/tensorflow/lite/delegates/gpu/metal/common.mm
index 3b514d3..7167430 100644
--- a/tensorflow/lite/delegates/gpu/metal/common.mm
+++ b/tensorflow/lite/delegates/gpu/metal/common.mm
@@ -34,31 +34,6 @@
 
 id<MTLDevice> GetBestSupportedMetalDevice() { return MTLCreateSystemDefaultDevice(); }
 
-int GetMacOsGpuVersion(id<MTLDevice> device) {
-#if defined(__MAC_10_11) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11
-  std::vector<std::pair<MTLFeatureSet, int>> features;
-  if (@available(macOS 10.11, *)) {
-    features.emplace_back(MTLFeatureSet_macOS_GPUFamily1_v1, 1);
-  }
-  if (@available(macOS 10.12, *)) {
-    features.emplace_back(MTLFeatureSet_macOS_GPUFamily1_v2, 1);
-  }
-  if (@available(macOS 10.13, *)) {
-    features.emplace_back(MTLFeatureSet_macOS_GPUFamily1_v3, 1);
-  }
-  if (@available(macOS 10.14, *)) {
-    features.emplace_back(MTLFeatureSet_macOS_GPUFamily1_v4, 1);
-    features.emplace_back(MTLFeatureSet_macOS_GPUFamily2_v1, 2);
-  }
-  for (const auto& type : features) {
-    if ([device supportsFeatureSet:type.first]) {
-      return type.second;
-    }
-  }
-#endif
-  return 0;
-}
-
 Status CreateComputeProgram(id<MTLDevice> device, NSString* code, NSString* functionName,
                             NSDictionary<NSString*, NSString*>* macros,
                             id<MTLComputePipelineState>* program) {
@@ -74,10 +49,10 @@
   } else if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
     [options setLanguageVersion:MTLLanguageVersion1_1];
   }
-#if (defined(__MAC_10_11) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11) ||  \
+#if (defined(__MAC_10_11) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11) ||    \
     (defined(__IPHONE_9_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0) || \
     (defined(__TVOS_9_0) && __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_9_0)
-    // Minimum target OS version is able to support Metal.
+  // Minimum target OS version is able to support Metal.
 #else
 #pragma message(VAR_NAME_VALUE(__MAC_OS_X_VERSION_MIN_REQUIRED))
 #pragma message(VAR_NAME_VALUE(__IPHONE_OS_VERSION_MIN_REQUIRED))
diff --git a/tensorflow/lite/delegates/gpu/metal/environment.h b/tensorflow/lite/delegates/gpu/metal/environment.h
index 90da1f3..598aab7 100644
--- a/tensorflow/lite/delegates/gpu/metal/environment.h
+++ b/tensorflow/lite/delegates/gpu/metal/environment.h
@@ -20,9 +20,6 @@
 namespace gpu {
 namespace metal {
 
-// Returns runtime operation system version. Example 10.1
-float GetiOsSystemVersion();
-
 // Returns Apple SoC generation number. The list of Apple SoC that support Metal
 // API:
 //     7 - A7 iPhone 5s, iPad Air, iPad Mini 2, iPad Mini 3.
diff --git a/tensorflow/lite/delegates/gpu/metal/environment.mm b/tensorflow/lite/delegates/gpu/metal/environment.mm
index f083bbf..57f7684 100644
--- a/tensorflow/lite/delegates/gpu/metal/environment.mm
+++ b/tensorflow/lite/delegates/gpu/metal/environment.mm
@@ -27,8 +27,6 @@
 namespace gpu {
 namespace metal {
 
-float GetiOsSystemVersion() { return [[[UIDevice currentDevice] systemVersion] floatValue]; }
-
 int GetAppleSocVersion() {
   int max_feature_set = 0;
 #if defined(__IPHONE_9_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0
diff --git a/tensorflow/lite/delegates/gpu/metal/environment_test.mm b/tensorflow/lite/delegates/gpu/metal/environment_test.mm
index 20909c6..6d64686 100644
--- a/tensorflow/lite/delegates/gpu/metal/environment_test.mm
+++ b/tensorflow/lite/delegates/gpu/metal/environment_test.mm
@@ -19,9 +19,7 @@
 
 #include "tensorflow/lite/delegates/gpu/metal/common.h"
 
-using ::tflite::gpu::metal::GetiOsSystemVersion;
 using ::tflite::gpu::metal::GetAppleSocVersion;
-using ::tflite::gpu::metal::GetMacOsGpuVersion;
 
 @interface EnvironmentTest : XCTestCase
 
@@ -42,27 +40,15 @@
 }
 
 - (void)testRunTimeOSDetection {
-  float runtimeOSVersion = GetiOsSystemVersion();
 #if IOS_VERSION > 0
-  XCTAssertTrue(runtimeOSVersion >= 8.0f, @"runtimeOSVersion: %f", runtimeOSVersion);
-
   int gpuVersion = GetAppleSocVersion();
   XCTAssertTrue(gpuVersion >= 7, @"gpu version: %d", gpuVersion);
 #endif
 
 #if TVOS_VERSION > 0
-  XCTAssertTrue(runtimeOSVersion >= 9.0f, @"runtimeOSVersion: %f", runtimeOSVersion);
-
   int gpuVersion = GetAppleSocVersion();
   XCTAssertTrue(gpuVersion >= 8, @"gpu version: %d", gpuVersion);
 #endif
-
-#if MACOS_VERSION > 0
-  XCTAssertTrue(runtimeOSVersion >= 10.11f, @"runtimeOSVersion: %f", runtimeOSVersion);
-
-  int gpuVersion = GetMacOsGpuVersion(device);
-  XCTAssertTrue(gpuVersion >= 1, @"gpu version: %d", gpuVersion);
-#endif
 }
 
 @end