Community
cancel
Showing results for
Did you mean:
Beginner
51 Views

## Problem getting mkl_scsrsv function to work.

Hi, I am just trying to solve a simple linear equation with this test program. I am using MKL 2017 with Microsoft Visual Studio and have tested other functions with the array matdescra with them working.

In the documentation, I tried following: void mkl_scsrsv (const char *transa , const MKL_INT *m , const float *alpha , const char *matdescra , const float *val , const MKL_INT *indx , const MKL_INT *pntrb , const MKL_INT *pntre , const float *x , float *y );

```#include <stdio.h>
#include <stdlib.h>
#include "mkl.h"

#define NNZ_A 12
#define M_A 6

/*
This sample program tries to compute:

[ 3.0, 0.0, 0.0, 4.0, 0.0, 0.0 ]                [1]
[ 0.0, 5.0, 0.0, 0.0, 0.0, 1.0 ]                [4]
[ 0.0, 0.0, 0.0, 6.0, 0.0, 0.0 ]      X   =     [6]
[ 0.0, 10.0, 0.0, 0.0, 11.0, 0.0 ]              [8]
[ 12.0, 0.0, 0.0, 1.0, 2.0, 3.0 ]		[2]
[ 0.0, 0.0, 8.0, 0.0, 0.0, 0.0 ]                [4]

*/

int main() {

float			A[NNZ_A] = { 3.0, 4.0, 5.0, 1.0, 6.0, 10.0, 11.0, 12.0, 1.0, 2.0, 3.0, 8.0 };
MKL_INT			A_col[NNZ_A] = { 1, 4, 2, 6, 4, 2, 5, 1, 4, 5, 6, 3 };
MKL_INT			A_rowIndex[M_A + 1] = { 1, 3, 5, 6, 8, 12, 13 };
char			matdescra[6];
char			transa = 'n';
MKL_INT m = M_A;
MKL_INT k = M_A;
float alpha = 1.0;

float			X[M_A] = { 1.0, 4.0, 6.0, 8.0, 2.0, 4.0 };
float			Y[M_A] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

matdescra[0] = 'g';
matdescra[3] = 'c';

mkl_scsrsv(&transa, &m, &alpha, matdescra, A, A_col, A_rowIndex, &(A_rowIndex[1]), X, Y);

getchar();

return 0;
}```

Yet I get the error message:
Intel MKL ERROR: Parameter 4 was incorrect on entry to MKL_SCSRSV.

I just cannot get matdescra working on the CSR function for some reason. I appreciate any help, I have been stuck on what to do.