From c680c3a0b3c7b50093610f0d9d17236d434409af Mon Sep 17 00:00:00 2001
From: Robert David <lrdx@google.com>
Date: Wed, 23 Sep 2020 17:47:58 -0700
Subject: [PATCH] Add ARM Mali G68 and G78 GPUs.

https://developer.arm.com/ip-products/graphics-and-multimedia/mali-gpus/mali-g68-gpu
https://developer.arm.com/ip-products/graphics-and-multimedia/mali-gpus/mali-g78-gpu

PiperOrigin-RevId: 333410430
Change-Id: Icacb4236a8fbd5395d191ee08b8e65d3cdc025ca
---
 tensorflow/lite/delegates/gpu/cl/device_info.cc | 6 ++++--
 tensorflow/lite/delegates/gpu/cl/device_info.h  | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tensorflow/lite/delegates/gpu/cl/device_info.cc b/tensorflow/lite/delegates/gpu/cl/device_info.cc
index 5d035e34617..43d050e8371 100644
--- a/tensorflow/lite/delegates/gpu/cl/device_info.cc
+++ b/tensorflow/lite/delegates/gpu/cl/device_info.cc
@@ -40,7 +40,8 @@ MaliGPU GetMaliGPUVersion(const std::string& device_name) {
       {"T830", MaliGPU::T830}, {"T860", MaliGPU::T860}, {"T880", MaliGPU::T880},
       {"G31", MaliGPU::G31},   {"G51", MaliGPU::G51},   {"G71", MaliGPU::G71},
       {"G52", MaliGPU::G52},   {"G72", MaliGPU::G72},   {"G76", MaliGPU::G76},
-      {"G57", MaliGPU::G57},   {"G77", MaliGPU::G77},
+      {"G57", MaliGPU::G57},   {"G77", MaliGPU::G77},   {"G68", MaliGPU::G68},
+      {"G78", MaliGPU::G78},
   };
   for (const auto& v : kMapping) {
     if (device_name.find(v.first) != std::string::npos) {
@@ -212,7 +213,8 @@ bool MaliInfo::IsBifrost() const {
 }
 
 bool MaliInfo::IsValhall() const {
-  return gpu_version == MaliGPU::G57 || gpu_version == MaliGPU::G77;
+  return gpu_version == MaliGPU::G57 || gpu_version == MaliGPU::G77 ||
+         gpu_version == MaliGPU::G68 || gpu_version == MaliGPU::G78;
 }
 
 bool DeviceInfo::SupportsTextureArray() const {
diff --git a/tensorflow/lite/delegates/gpu/cl/device_info.h b/tensorflow/lite/delegates/gpu/cl/device_info.h
index abb3feb07b1..f28f4719232 100644
--- a/tensorflow/lite/delegates/gpu/cl/device_info.h
+++ b/tensorflow/lite/delegates/gpu/cl/device_info.h
@@ -95,6 +95,8 @@ enum class MaliGPU {
   G76,
   G57,
   G77,
+  G68,
+  G78,
   UNKNOWN
 };