From c9cb48d1753a0bdd87bb59b34270f076bed5ae95 Mon Sep 17 00:00:00 2001 From: jan Date: Mon, 4 Jul 2016 22:55:59 -0700 Subject: [PATCH] Add CSR sparse matrix-vector multiply operation --- opencl_fdfd/ops.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/opencl_fdfd/ops.py b/opencl_fdfd/ops.py index dd39e45..7d51e58 100644 --- a/opencl_fdfd/ops.py +++ b/opencl_fdfd/ops.py @@ -224,3 +224,35 @@ def create_dot(context): return g.get() return ri_update + + +def create_a_csr(context): + spmv_source = ''' + int start = m_row_ptr[i]; + int stop = m_row_ptr[i+1]; + cdouble_t dot = cdouble_new(0.0, 0.0); + + int col_ind, d_ind; + for (int j=start; j