Skip to content

Commit 356be23

Browse files
committed
[unified] revert partially adding restrict
In benchmarks the (add|sub)_diag operations could experience significant slowdowns (up to 30% for single-threaded n=20k on intel), while the benefit in other cases was not as significant.
1 parent 87c3acb commit 356be23

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

common/unified/matrix/dense_kernels.template.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ void add_scaled_diag(std::shared_ptr<const DefaultExecutor> exec,
196196
y(i, i) += alpha[0] * diag[i];
197197
}
198198
},
199-
x->get_size()[0], as_restrict(alpha),
200-
as_restrict(x->get_const_values()), as_restrict(y));
199+
x->get_size()[0], alpha->get_const_values(), x->get_const_values(), y);
201200
}
202201

203202

@@ -215,8 +214,7 @@ void sub_scaled_diag(std::shared_ptr<const DefaultExecutor> exec,
215214
y(i, i) -= alpha[0] * diag[i];
216215
}
217216
},
218-
x->get_size()[0], as_restrict(alpha),
219-
as_restrict(x->get_const_values()), as_restrict(y));
217+
x->get_size()[0], alpha->get_const_values(), x->get_const_values(), y);
220218
}
221219

222220

0 commit comments

Comments
 (0)