- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi, has anyone encounterd the situation I met? All I did was try to convert a sparse matrix in CSC format to CSR format.

At the foremost , I use mkl_sparse_z_creat_csc to create a matrix in CSC format, and the stat is '0', which shows that the creation is successful, and I use mkl_sparse_convert_csr to get matrix in CSR format. I`ve tried this function using a small matrix and surely it works, however, when I use it to convert a big matrix, the compiler suddenly occur to prompt me that there exists an Access Conflict when running the convert function, and I have no idea why this hint comes to me, so is there anyone knows why?

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

what mkl version do you use? we don't know such problem with the latest 2019.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi, after checking my code, I find an error in assembling CSC matrix, and I`ve solved this problem, thx a lot.

By the way, if I try to compute the multiplication of two CSR matrix A and B with sparse_index_base_one both using mak_sparse_spmm to get another sparse matrix C, when I use mkl_sparse_?_export_csr, I find that the sparse_index_base is zero instead of one, is it correct or the function return the default internal data type rather than the input value?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

This looks like a problem. the output array should be indexed like the input arrays. Could you give us the example of this case?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Gennady F. (Intel) wrote:This looks like a problem. the output array should be indexed like the input arrays. Could you give us the example of this case?

Hi,Gennedy

This case has appeared many times during my compute, and here is a easier way to actualize it:

1. Using mkl_sparse_?_create_csr to create two sparse matrix A and B with sparse_index_base_one

2.Using mkl_sparse_?_add to compute the sum of the two matrix and store the result as a sparse matrix C, or you can use mkl_sparse_spmm to compute the product of he two matrix

3. Export sparse matrix C and you will find out that the sparse_index_base is zero.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello everyone,

I would like to chime in here, since I am facing pretty much the same issue. In my case I create a scaling matrix in coordinate format and try to convert it to csr format afterwards. This ends up with an error stating "Access violation writing location", as it seemed to be the case for wen_qiang_z_. Basically I am creating the coo matrix like this:

const int valueAmount(13);

double coo_values[valueAmount] = { 1,2,3,4,5,6,7,8,9,10,11,12,13 };

int coo_RowIndx[valueAmount], coo_ColumnIndx[valueAmount] = { 0,1,2,3,4,5,6,7,8,9,10,11,12};

sparse_matrix_t B,C;

sparse_status_t stat = mkl_sparse_d_create_coo(&B, SPARSE_INDEX_BASE_ZERO, valueAmount, valueAmount, valueAmount, coo_RowIndx, coo_ColumnIndx, coo_values);

This ends with SPARSE_STATUS_SUCCESS and afterwards I want to transfer it:

mkl_sparse_convert_csr(B, SPARSE_OPERATION_TRANSPOSE, &C);

At this point I get the exception: "Exception thrown at 0x00007FFA98EA314F (mkl_sequential.1.dll) in Playground.exe: 0xC0000005: Access violation writing location 0x000001A551D3A330."

I would be glad about any hint about how to proceed.

Btw. the code is compile with Intel C++ 19.2 Compiler, using MKL 2021

Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

From your description, it seems to me that you have not entered any values into the array coo_RowIndx before passing the array to the MKL routines.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thanks, that was the issue.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page