Skip to content

Add OpenCL matrix eadd and emult - #309

Open
LuhTonkaYeat wants to merge 2 commits into
SparseLinearAlgebra:mainfrom
LuhTonkaYeat:feature/cl-m-eadd-emult
Open

LuhTonkaYeat wants to merge 2 commits into
SparseLinearAlgebra:mainfrom
LuhTonkaYeat:feature/cl-m-eadd-emult

Conversation

@LuhTonkaYeat

Copy link
Copy Markdown

Adds OpenCL implementations of element-wise matrix addition (m_eadd) and multiplication (m_emult) for CSR matrices.

Implementation: count per row → exclusive scan into Ap → scatter into Aj/Ax. m_eadd is a row-wise union (op on matched columns, single entries copied); m_emult is a row-wise intersection. Fill-value filtering matches the CPU implementation. Adaptive launch: thread per row for short rows, work-group per row (32 threads) for long rows (avg nnz/row ≥ 32). Also fixes cl_csr_read for empty CSR.

Tests: test_opencl_eadd_emult (8 cases) and existing test_matrix (10 cases).

@LuhTonkaYeat
LuhTonkaYeat force-pushed the feature/cl-m-eadd-emult branch from e7d7d79 to 8b541d6 Compare December 2, 2026 06:26

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant