message: advanced spmv reference
diff: @@ -86,23 +86,32 @@ void advanced_spmv(std::shared_ptr<const ReferenceExecutor> exec,
  const matrix::Dense<ValueType> *beta,
  matrix::Dense<ValueType> *c)
  {
  - // auto max_nonzeros_per_row = a->get_max_nonzeros_per_row();
  - // auto alpha_val = alpha->at(0, 0);
  - // auto beta_val = beta->at(0, 0);
  -
  - // for (size_type row = 0; row < a->get_size().num_rows; row++) {
  - // for (size_type j = 0; j < c->get_size().num_cols; j++) {
  - // c->at(row, j) *= beta_val;
  - // }
  - // for (size_type i = 0; i < max_nonzeros_per_row; i++) {
  - // auto val = a->val_at(row, i);
  - // auto col = a->col_at(row, i);
  - // for (size_type j = 0; j < c->get_size().num_cols; j++) {
  - // c->at(row, j) += alpha_val * val * b->at(col, j);
  - // }
  - // }
  - // }
  - NOT_IMPLEMENTED;
  + auto vals = a->get_const_values();
  + auto col_idxs = a->get_const_col_idxs();
  + auto slice_lengths = a->get_const_slice_lengths();
  + auto slice_sets = a->get_const_slice_sets();
  + auto slice_size = a->get_slice_size();
  + int slice_num = (a->get_size().num_rows + slice_size - 1) / slice_size;
  + auto valpha = alpha->at(0, 0);
  + auto vbeta = beta->at(0, 0);
  + for (size_type slice = 0; slice < slice_num; slice++) {
  + for (size_type row = 0; row < slice_size; row++) {
  + size_type global_row = slice * slice_size + row;
  + if (global_row >= a->get_size().num_rows) {
  + break;
  + }
  + for (size_type j = 0; j < c->get_size().num_cols; j++) {
  + c->at(global_row, j) *= vbeta;
  + }
  + for (size_type i = 0; i < slice_lengths[slice]; i++) {
  + auto val = a->val_at(row, slice_sets[slice], i);
  + auto col = a->col_at(row, slice_sets[slice], i);
  + for (size_type j = 0; j < c->get_size().num_cols; j++) {
  + c->at(global_row, j) += valpha * val * b->at(col, j);
  + }
  + }
  + }
  + }
  }
  GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
  