Date: 2025-03-29T05:58:34+00:00

Actual source code: baijmkl.h

      1: #pragma once

      3: #define MKL_Complex16 PetscScalar
      4: #define MKL_Complex8  PetscScalar
      5: #define PetscCallMKL(stat) \
      6:   do { \
      7:     PetscCheck(stat == SPARSE_STATUS_SUCCESS, PETSC_COMM_SELF, PETSC_ERR_LIB, "Error in MKL sparse matrix call"); \
      8:   } while (0)
      9: #if !defined(PETSC_USE_COMPLEX)
     10:   #if defined(PETSC_USE_REAL_SINGLE)
     11:     #define mkl_sparse_x_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values) mkl_sparse_s_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values)
     12:   #elif defined(PETSC_USE_REAL_DOUBLE)
     13:     #define mkl_sparse_x_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values) mkl_sparse_d_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values)
     14:   #endif
     15: #else
     16:   #if defined(PETSC_USE_REAL_SINGLE)
     17:     #define mkl_sparse_x_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values) mkl_sparse_c_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values)
     18:   #elif defined(PETSC_USE_REAL_DOUBLE)
     19:     #define mkl_sparse_x_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values) mkl_sparse_z_create_bsr(A, indexing, block_layout, rows, cols, block_size, rows_start, rows_end, col_indx, values)
     20:   #endif
     21: #endif

     23: #if !defined(PETSC_USE_COMPLEX)
     24:   #if defined(PETSC_USE_REAL_SINGLE)
     25:     #define mkl_sparse_x_mv(operation, alpha, A, descr, x, beta, y) mkl_sparse_s_mv(operation, alpha, A, descr, x, beta, y)
     26:   #elif defined(PETSC_USE_REAL_DOUBLE)
     27:     #define mkl_sparse_x_mv(operation, alpha, A, descr, x, beta, y) mkl_sparse_d_mv(operation, alpha, A, descr, x, beta, y)
     28:   #endif
     29: #else
     30:   #if defined(PETSC_USE_REAL_SINGLE)
     31:     #define mkl_sparse_x_mv(operation, alpha, A, descr, x, beta, y) mkl_sparse_c_mv(operation, alpha, A, descr, x, beta, y)
     32:   #elif defined(PETSC_USE_REAL_DOUBLE)
     33:     #define mkl_sparse_x_mv(operation, alpha, A, descr, x, beta, y) mkl_sparse_z_mv(operation, alpha, A, descr, x, beta, y)
     34:   #endif
     35: #endif