Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use SpBlas #1

Open
AviAvni opened this issue Dec 24, 2018 · 2 comments
Open

How to use SpBlas #1

AviAvni opened this issue Dec 24, 2018 · 2 comments

Comments

@AviAvni
Copy link

AviAvni commented Dec 24, 2018

I'm trying to use the SpBlas API but get error

static void Main(string[] args)
{
    double[] values_A = { 10, 11, 12, 13, 15, 14, 16, 17, 18, 19 };
    int[] columns_A = { 0, 1, 2, 3, 0, 4, 1, 2, 3, 4 };
    int[] rowIndex_A1 = { 0, 2, 4, 6, 8, 10 };
    int[] rowIndex_A2 = { 2, 4, 6, 8, 10 };

    double[] values_B = { 5, 6, 7, 8, 9 };
    int[] columns_B = { 0, 1, 2, 3, 4 };
    int[] rowIndex_B1 = { 0, 1, 2, 3, 4, 5 };
    int[] rowIndex_B2 = { 1, 2, 3, 4, 5 };

    var a = new SparseMatrix();
    var b = new SparseMatrix();

    var res = SpBlas.MklSparseDCreateCsr(a, SparseIndexBaseT.SPARSE_INDEX_BASE_ZERO, 5, 5, ref rowIndex_A1[0], ref rowIndex_A2[0], ref columns_A[0], ref values_A[0]);
    res = SpBlas.MklSparseDCreateCsr(b, SparseIndexBaseT.SPARSE_INDEX_BASE_ZERO, 5, 5, ref rowIndex_B1[0], ref rowIndex_B2[0], ref columns_B[0], ref values_B[0]);

    var c = new SparseMatrix();
    res = SpBlas.MklSparseSpmm(SparseOperationT.SPARSE_OPERATION_NON_TRANSPOSE, a, b, c); // res is IntelMKL.LP64.SparseStatusT.SPARSE_STATUS_NOT_SUPPORTED
    res = SpBlas.MklSparseDSetValue(a, 1, 2, 10); // Exception: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

}

What is wrong here?

@AviAvni AviAvni changed the title How to using SpBlas How to use SpBlas Dec 24, 2018
@allisterb
Copy link
Owner

Hi sorry for taking so long to respond. I'm going to look at this issue today.

@AviAvni
Copy link
Author

AviAvni commented Jan 6, 2019

@allisterb any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants