Skip to content

Commit 5a4a5fd

Browse files
committed
[unified] add restrict to some dense kernels
1 parent 9ee2c34 commit 5a4a5fd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

common/unified/matrix/dense_kernels.template.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void add_scaled(std::shared_ptr<const DefaultExecutor> exec,
152152
y(row, col) += alpha[0] * x(row, col);
153153
}
154154
},
155-
x->get_size(), alpha->get_const_values(), x, y);
155+
x->get_size(), as_restrict(alpha), as_restrict(x), as_restrict(y));
156156
}
157157
}
158158

@@ -177,7 +177,7 @@ void sub_scaled(std::shared_ptr<const DefaultExecutor> exec,
177177
y(row, col) -= alpha[0] * x(row, col);
178178
}
179179
},
180-
x->get_size(), alpha->get_const_values(), x, y);
180+
x->get_size(), as_restrict(alpha), as_restrict(x), as_restrict(y));
181181
}
182182
}
183183

@@ -196,7 +196,8 @@ 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], alpha->get_const_values(), x->get_const_values(), y);
199+
x->get_size()[0], as_restrict(alpha),
200+
as_restrict(x->get_const_values()), as_restrict(y));
200201
}
201202

202203

@@ -214,7 +215,8 @@ void sub_scaled_diag(std::shared_ptr<const DefaultExecutor> exec,
214215
y(i, i) -= alpha[0] * diag[i];
215216
}
216217
},
217-
x->get_size()[0], alpha->get_const_values(), x->get_const_values(), y);
218+
x->get_size()[0], as_restrict(alpha),
219+
as_restrict(x->get_const_values()), as_restrict(y));
218220
}
219221

220222

0 commit comments

Comments
 (0)