Skip to content

Customize:Kernels

NCIC-AlphaSparse edited this page Dec 7, 2024 · 3 revisions

How to add new kernel of one specific sparse storage format

For instance, if I want to add sp2m to the library, the steps are as follows:

  1. Add CSR、 CSC、 COO and BSR to headers of "def_x.h" in "include/alphasparse/kernel"

Use the #define to specify the datatype of the same format:

e.g. #define sp2m_csr sp2m_s_csr //for float datatype and csr format

  1. Add the declaration of kernels to headers of kernel_format_datatype.h in path "include/alphasparse/kernel

e.g. alphasparseStatus_t sp2m_s_csr(const spmat_csr_s_t *A, const spmat_csr_s_t *B, spmat_csr_s_t **C);

  1. Add the user interfaces implementation in "alphasparse_sp2m.cpp" in path "platform/kernel/levelx"

  2. Add the kernel implementation, such as sp2m_s_csr.cpp , in path "platform/kernel/levelx".

Home

Customize:Formats

Customize:Kernels

Customize:Backends

  1. why pi is irrational

  2. why pi is important

  3. Pi is everywhere!

  4. Fancy using pi.

Clone this wiki locally