--- a/cupy_backends/cuda/libs/cusparse.pxd	2026-06-02 21:49:12.954751648 +0200
+++ b/cupy_backends/cuda/libs/cusparse.pxd	2026-06-02 21:49:23.053208411 +0200
@@ -70,11 +70,14 @@
     ctypedef int Csr2CscAlg 'cusparseCsr2CscAlg_t'
 
 # TODO(eriknw): cuSPARSE--remove stubs when SpGEAM ships in a public release.
-# The #ifndef guard auto-deactivates when the real header defines these.
+# cuSPARSE 12.8.1+ (CUDA 13.3+) defines SpGEAM as an enum, not a #define, so
+# the old #ifndef guard was ineffective. Include cusparse.h first to get
+# CUSPARSE_VERSION, then guard on the version. verified 2026-06-02
 cdef extern from *:
     """
-    #ifndef CUSPARSE_SPGEAM_ALG_DEFAULT
-    /* SpGEAM not in this cuSPARSE; provide opaque forward decls. */
+    #include <cusparse.h>
+    #if CUSPARSE_VERSION < 12801
+    /* SpGEAM not in this cuSPARSE (< 12.8.1); provide opaque forward decls. */
     typedef void* cusparseSpGEAMDescr_t;
     typedef int cusparseSpGEAMAlg_t;
     #define CUSPARSE_SPGEAM_ALG_DEFAULT 0
