Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

Issue with mkl_sparse_z_export_csr

$
0
0

Hello,

I use mkl_sparse_z_export_csr to export a CSR handle from internal representation. I double checked the exported values and they are all correct. However, when I use the following code to convert "Values" to conjugate of "Values" everything becomes zero (even the real part which I didn't touch)! Any idea what is going wrong? I am using latest version of Intel MKL 2019. Thank you for your help.

 

sparse_matrix_t C_CSR_Handle = NULL

/* First, I use mkl_sparse_spmm() function to multiply two matrices and save the results in C_CSR_Handle */
mkl_sparse_spmm(SPARSE_OPERATION_NON_TRANSPOSE, A_CSR_Handle, B_CSR_Handle, &C_CSR_Handle)

sparse_index_base_t indexing = 0;
MKL_INT rows, cols;
MKL_INT *JA= NULL, *PointerE = NULL, *IA= NULL;
MKL_Complex16 *Values= NULL;

sparse_index_base_t indexing1 = 0;
MKL_INT rows1, cols1; 
MKL_INT *JA1= NULL, *PointerE1 = NULL, *IA1= NULL; 
MKL_Complex16 *Values1= NULL;

mkl_sparse_z_export_csr(C_CSR_Handle, &indexing, &rows, &cols, &JA, &PointerE, &IA, &Values);
mkl_sparse_z_export_csr(C_CSR_Handle, &indexing1, &rows1, &cols1, &JA1, &PointerE1, &IA1, &Values1);

for (i = 0; i < JA[rows]; i++) {
   printf("values(%i) = %f , %f \n", i, Values[i].real, Values[i].imag); // print values before making any changes
   Values[i].imag = Values[i].imag*(-1); 
   Values1[i].imag = Values1[i].imag*(-1); 
   printf("values(%i) = %f , %f \n", i, Values[i].real, Values[i].imag); // print values after modification
}

 


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>