what is the proper way to give __restrict__
qualifier to two-dimensional array reference?
for example:
void function(double (&)[3][3]);
as far as I can tell, g++
compiles the following (but no performance difference):
void function(double (& __restrict__)[3][3]);
is that correct?
full segment:
template<class A, class B, class C>
static void
multiply(const A (&a)[L][L], const B (&b)[L][L],
C (&c)[L][L]) {
// C (&__restrict__ c)[L][L]) {
for (size_t j = 0; j < L; ++j) {
// C __restrict__ *cj = c[j];
for (size_t k = 0; k < L; ++k) {
double b_jk = b[j][k];
for (size_t i = 0; i < L; ++i) {
c[j][i] += a[k][i]*b_jk;
// cj[i] += a[k][i]*b_jk;
}
}
}
}