From d02ab5c618c9798d085a9223bc37041a465d587f Mon Sep 17 00:00:00 2001
From: Ben Frederickson <ben@benfrederickson.com>
Date: Mon, 9 Dec 2024 13:45:47 -0800
Subject: [PATCH] Skip gtests for Rmat Lanczos tests with cuda <= 11.4 (#2525)

Similar to #2520, also skip gtests for cuda 11.4 on the RmatLanczosTest
as well
---
 cpp/test/sparse/solver/lanczos.cu | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/cpp/test/sparse/solver/lanczos.cu b/cpp/test/sparse/solver/lanczos.cu
index 6e349627b2..128ab73747 100644
--- a/cpp/test/sparse/solver/lanczos.cu
+++ b/cpp/test/sparse/solver/lanczos.cu
@@ -109,6 +109,18 @@ class rmat_lanczos_tests
 
   void Run()
   {
+    int runtimeVersion;
+    cudaError_t result = cudaRuntimeGetVersion(&runtimeVersion);
+
+    if (result == cudaSuccess) {
+      int major = runtimeVersion / 1000;
+      int minor = (runtimeVersion % 1000) / 10;
+
+      // Skip gtests for CUDA 11.4.x and below because hard-coded results are causing issues.
+      // See https://github.com/rapidsai/raft/issues/2519 for more information.
+      if (major == 11 && minor <= 4) { GTEST_SKIP(); }
+    }
+
     uint64_t n_edges   = sparsity * ((long long)(1 << r_scale) * (long long)(1 << c_scale));
     uint64_t n_nodes   = 1 << std::max(r_scale, c_scale);
     uint64_t theta_len = std::max(r_scale, c_scale) * 4;