# magma_ilu_info_t incorrectly defined for hipSPARSE

24 views

### Austin Harris

Jun 9, 2022, 1:49:54 PMJun 9
to MAGMA User
In `sparse/include/magmasparse_types.h`, `magma_ilu_info_t` is defined as `hipsparseSolveAnalysisInfo_t`, which doesn't exist. `csrsm2Info_t` should be used instead (at least in ROCm v5.1.0).

There are multiple ways to fix this, but I'm not sure which you'd to use. Below is a diff of the fix I used.

```
> git diff sparse/include/magmasparse_types.h
diff --git a/sparse/include/magmasparse_types.h b/sparse/include/magmasparse_types.h
index cae0a5b8..2eb9e931 100644
--- a/sparse/include/magmasparse_types.h
+++ b/sparse/include/magmasparse_types.h
@@ -629,7 +629,7 @@ typedef struct magma_s_vector

//************            preconditioner parameters       ********************//

-#if CUDA_VERSION < 11031 || defined(MAGMA_HAVE_HIP)
+#if CUDA_VERSION < 11031
typedef struct magma_solve_info_t
{
csrsm2Info_t descr{};
@@ -639,7 +639,11 @@ typedef struct magma_solve_info_t
#else
typedef struct magma_solve_info_t
{
+#if defined(MAGMA_HAVE_HIP)
+    csrsm2Info_t descr{};
+#else
cusparseSpSMDescr_t descr{};
+#endif
void *buffer{};
} magma_solve_info_t;
#define magma_ilu_info_t csrsm2Info_t

```

### Austin Harris

Jun 9, 2022, 2:02:27 PMJun 9
to MAGMA User, Austin Harris
This was the incorrect patch. The correct one below:

```
> git diff sparse/include/magmasparse_types.h
diff --git a/sparse/include/magmasparse_types.h b/sparse/include/magmasparse_types.h
index cae0a5b8..65f37613 100644
--- a/sparse/include/magmasparse_types.h
+++ b/sparse/include/magmasparse_types.h
@@ -635,7 +635,11 @@ typedef struct magma_solve_info_t
csrsm2Info_t descr{};
void *buffer{};
} magma_solve_info_t;
+#if defined(MAGMA_HAVE_HIP)
+#define magma_ilu_info_t csrsm2Info_t
+#else
#define magma_ilu_info_t cusparseSolveAnalysisInfo_t
+#endif
#else
typedef struct magma_solve_info_t
{

```