Near-memory primitive support and infratructure for sparse algorithm