GPU: Remove obsolete GPU compatibility code

libeigen/eigen!2974

diff --git a/.agents/ci.md b/.agents/ci.md
index 112343a..ce2e729 100644
--- a/.agents/ci.md
+++ b/.agents/ci.md
@@ -106,9 +106,9 @@
 - No affected-tier configuration enables CUDA, HIP or SYCL, so a diff confined to GPU test sources would select targets
   no host build has and read green having run nothing. Those paths add the existing CUDA jobs instead, which build
   `buildtests_gpu` and run the whole `gpu` label: coverage of the GPU suite, not of the affected subset.
-- `arch/ZVector`, `arch/MSA`, `arch/HVX` and the `arch/HIP` and `arch/SYCL` backends have no matching test
-  configuration, so a change there gets only the four unconditional jobs and the same hollow result; `gpu-tests` is no
-  help either, since the GPU jobs it gates are all CUDA.
+- `arch/ZVector`, `arch/MSA`, `arch/HVX` and the `arch/SYCL` backend have no matching test configuration, so a change
+  there gets only the four unconditional jobs and the same hollow result; `gpu-tests` is no help either, since the GPU
+  jobs it gates are all CUDA or ROCm.
 
 ## Worktree-Safe Formatting
 
diff --git a/Eigen/src/Core/arch/HIP/hcc/math_constants.h b/Eigen/src/Core/arch/HIP/hcc/math_constants.h
deleted file mode 100644
index 34dad53..0000000
--- a/Eigen/src/Core/arch/HIP/hcc/math_constants.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * math_constants.h -
- *  HIP equivalent of the CUDA header of the same name
- */
-// SPDX-FileCopyrightText: The Eigen Authors
-// SPDX-License-Identifier: MPL-2.0
-
-#ifndef __MATH_CONSTANTS_H__
-#define __MATH_CONSTANTS_H__
-
-/* single precision constants */
-
-#define HIPRT_INF_F __int_as_float(0x7f800000)
-#define HIPRT_NAN_F __int_as_float(0x7fffffff)
-#define HIPRT_MIN_DENORM_F __int_as_float(0x00000001)
-#define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff)
-#define HIPRT_NEG_ZERO_F __int_as_float(0x80000000)
-#define HIPRT_ZERO_F 0.0f
-#define HIPRT_ONE_F 1.0f
-
-/* double precision constants */
-#define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000)
-#define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000)
-
-#endif
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index 7201ba5..02132ea 100644
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -15,20 +15,6 @@
 // IWYU pragma: private
 #include "../InternalHeaderCheck.h"
 
-#if defined(EIGEN_GPU_COMPILE_PHASE)
-
-#include <cfloat>
-
-#if defined(EIGEN_CUDA_ARCH)
-#include <math_constants.h>
-#endif
-
-#if defined(EIGEN_HIP_DEVICE_COMPILE)
-#include "Eigen/src/Core/arch/HIP/hcc/math_constants.h"
-#endif
-
-#endif
-
 // Define portable (u)int{32,64} types
 #include <cstdint>
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 1c211af..da6f25b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -655,9 +655,10 @@
     message(FATAL_ERROR "Eigen requires ROCm/HIP >= 5.6, found ${HIP_VERSION}")
   endif()
   if (HIP_FOUND)
-    execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
+    execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM
+                    OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-    if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
+    if (HIP_PLATFORM STREQUAL "amd")
 
       include_directories(${HIP_PATH}/include)
 
@@ -666,7 +667,7 @@
       ei_add_test(gpu_example)
       unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
 
-    elseif ((${HIP_PLATFORM} STREQUAL "nvcc") OR (${HIP_PLATFORM} STREQUAL "nvidia"))
+    elseif (HIP_PLATFORM STREQUAL "nvcc" OR HIP_PLATFORM STREQUAL "nvidia")
       message(FATAL_ERROR "HIP_PLATFORM = nvcc is not supported within Eigen")
     else ()
       message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt
index 2ee7626..db55a8a 100644
--- a/unsupported/test/CMakeLists.txt
+++ b/unsupported/test/CMakeLists.txt
@@ -310,9 +310,10 @@
 
   find_package(HIP REQUIRED)
   if (HIP_FOUND)
-    execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
+    execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM
+                    OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-    if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
+    if (HIP_PLATFORM STREQUAL "amd")
       include_directories(${CMAKE_CURRENT_BINARY_DIR})
       include_directories(${HIP_PATH}/include)
 
@@ -337,7 +338,7 @@
 
       unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
 
-    elseif ((${HIP_PLATFORM} STREQUAL "nvcc") OR (${HIP_PLATFORM} STREQUAL "nvidia"))
+    elseif (HIP_PLATFORM STREQUAL "nvcc" OR HIP_PLATFORM STREQUAL "nvidia")
       message(FATAL_ERROR "HIP_PLATFORM = nvcc is not supported within Eigen")
     else ()
       message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")