'Why isn't my mkl sparse matrix module working properly?

I first created a CSR matrix using the mkl sparse matrix module. This part is normal and can be created. Then I used mkl_sparse_s_add for matrix addition, and then the program reported an error. The content of the error report is Exception thrown at 0x00007FFDA75F478C (KernelBase.dll) (in mkl.exe): 0xC06D007E: Module not found (parameter: 0x000000CEB30FF5B0). Here's my code

#include <stdio.h>
#include <assert.h>
#include <math.h>
#include "mkl_spblas.h"
#include <mkl.h>

int main() {
    MKL_INT rowPtr[6] = { 0,3,5,8,11,13 };
    MKL_INT columns[13] = { 0,1,3,0,1,2,3,4,0,2,3,1,4 };
    float values[13] = { 1,-1,-3,-2,5,4,6,4,-4,2,7,8,-5 };
    sparse_matrix_t elementMatrix2; sparse_matrix_t elementMatrix3;
    mkl_sparse_s_create_csr(&elementMatrix2,SPARSE_INDEX_BASE_ZERO,5,5,rowPtr,rowPtr+1,columns,values);
    mkl_sparse_s_add(SPARSE_OPERATION_NON_TRANSPOSE, elementMatrix2, 1, elementMatrix2, &elementMatrix3);
}

Helps me run the program normally



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source