Compilation error on macos with GPU delegate
I followed these directions on MacOS: https://www.tensorflow.org/lite/guide/build_cmake#opencl_gpu_delegate on r2.15 and nightly. I'm running into a different issue actually:

This part works fine:
```
cmake ../tensorflow_src/tensorflow/lite -DTFLITE_ENABLE_GPU=ON
```
but
```
cmake --build . -j
```
fails here:
```
gmake[1]: *** [CMakeFiles/Makefile2:6653: _deps/xnnpack-build/CMakeFiles/microkernels-all.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 56%] Linking CXX static library libabsl_stacktrace.a
[ 56%] Built target ruy_tune
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/base/CMakeFiles/absl_malloc_internal.dir/internal/low_level_alloc.cc.o
[ 56%] Built target ruy_thread_pool
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/strings/CMakeFiles/absl_strings_internal.dir/internal/ostringstream.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/strings/CMakeFiles/absl_strings_internal.dir/internal/escaping.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/strings/CMakeFiles/absl_strings_internal.dir/internal/utf8.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/hash/CMakeFiles/absl_city.dir/internal/city.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/crc/CMakeFiles/absl_crc_cpu_detect.dir/internal/cpu_detect.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/log/CMakeFiles/absl_log_internal_conditions.dir/internal/conditions.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/debugging/CMakeFiles/absl_demangle_internal.dir/internal/demangle.cc.o
[ 56%] Building CXX object _deps/abseil-cpp-build/absl/hash/CMakeFiles/absl_low_level_hash.dir/internal/low_level_hash.cc.o
[ 56%] Built target absl_random_internal_randen_hwaes
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/abs.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/clamp.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/average-pooling-2d.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/memory-planner.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/tensor.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/static-transpose.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/ceiling.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/depthwise-convolution-2d.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/copy.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/global-sum-pooling.c.o
[ 56%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/static-reshape.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/add2.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/global-average-pooling.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/softmax.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/elu.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/hardswish.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/convert.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/unpooling-2d.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/concatenate.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/leaky-relu.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/fully-connected.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/maximum2.c.o
[ 57%] Linking CXX static library libabsl_log_internal_conditions.a
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/depth-to-space.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/sigmoid.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/bankers-rounding.c.o
[ 57%] Linking CXX static library libabsl_low_level_hash.a
[ 57%] Linking CXX static library libabsl_malloc_internal.a
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/deconvolution-2d.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/squared-difference.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/max-pooling-2d.c.o
[ 57%] Linking CXX static library libabsl_strings_internal.a
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/square-root.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/subtract.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/prelu.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/tanh.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/static-constant-pad.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/static-resize-bilinear-2d.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/negate.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/validation.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/runtime.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/static-slice.c.o
[ 57%] Linking CXX static library libabsl_demangle_internal.a
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/minimum2.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/divide.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/square.c.o
[ 57%] Linking CXX static library libabsl_city.a
[ 57%] Built target absl_malloc_internal
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/space-to-depth-2d.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/argmax-pooling-2d.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/convolution-2d.c.o
[ 57%] Built target absl_low_level_hash
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/even-split.c.o
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/multiply2.c.o
[ 57%] Linking CXX static library libabsl_crc_cpu_detect.a
[ 57%] Built target absl_strings_internal
[ 57%] Built target absl_city
[ 57%] Built target absl_stacktrace
[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/subgraph.dir/src/subgraph/floor.c.o
[ 57%] Built target absl_demangle_internal
[ 57%] Built target absl_log_internal_conditions
[ 57%] Built target absl_crc_cpu_detect
[ 57%] Built target subgraph
gmake: *** [Makefile:136: all] Error 2
```

@terryheo, can you please take a look? Thanks.
### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.15.0

### Custom code

No

### OS platform and distribution

Macos 14.3.1

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

Apple clang 15.0.0

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I'm trying to build tensorflow-lite with the GPU delegates with CMake. It works well with Linux and Android (gcc), but for Macos (apple clang compiler) , I have a compilation error:
`tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:72:10: error: no matching function for call to 'visit'
  return std::visit(ObjectTypeGetter{}, object);`

It complains about using std::visit on a absl::variant.

My guess is that std::visit with gcc is more permissive than the standard about std::visit and allow to use it with not only std::variant but also with other variant-like. On the other side, Clang is not that permissive.

I tried with the source from the 2.15.0 and also with the sources of the latest commit.

### Standalone code to reproduce the issue

```shell
cd tensorflow/lite && cmake -B build -DTFLITE_ENABLE_GPU=ON && cmake --build build
```


### Relevant log output

```shell
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:72:10: error: no matching function for call to 'visit'
  return std::visit(ObjectTypeGetter{}, object);
         ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1753:26: note: candidate template ignored: substitution failure [with _Visitor = tflite::gpu::(anonymous namespace)::ObjectTypeGetter, _Vs = <const absl::variant<std::monostate, tflite::gpu::OpenGlBuffer, tflite::gpu::OpenGlTexture, tflite::gpu::CpuMemory, tflite::gpu::OpenClBuffer, tflite::gpu::OpenClTexture, tflite::gpu::VulkanBuffer, tflite::gpu::VulkanTexture> &>]: no matching function for call to '__as_variant'
constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
                         ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:79:10: error: no matching function for call to 'visit'
         std::visit(ObjectValidityChecker{def.object_def.data_type}, object);
         ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1753:26: note: candidate template ignored: substitution failure [with _Visitor = tflite::gpu::(anonymous namespace)::ObjectValidityChecker, _Vs = <const absl::variant<std::monostate, tflite::gpu::OpenGlBuffer, tflite::gpu::OpenGlTexture, tflite::gpu::CpuMemory, tflite::gpu::OpenClBuffer, tflite::gpu::OpenClTexture, tflite::gpu::VulkanBuffer, tflite::gpu::VulkanTexture> &>]: no matching function for call to '__as_variant'
constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
                         ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:85:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<CpuMemory>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
               ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:87:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<OpenGlBuffer>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
               ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:89:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<OpenGlTexture>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
               ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:91:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<OpenClBuffer>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
               ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:93:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<OpenClTexture>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
               ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:95:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<VulkanBuffer>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
               ^
/Users/lbertho/devel/.sx/build/tensorflow-lite/tensorflow/lite/delegates/gpu/api.cc:97:14: error: no matching function for call to 'holds_alternative'
      return std::holds_alternative<VulkanTexture>(obj);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/variant:1502:16: note: candidate template ignored: could not match 'std::variant' against 'absl::variant'
constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
```
