S
SzH
I understand that __restrict__ is a gcc extension, and not in the
official standard, but I got no reply on the gcc-help mailing list.
Since more people are reading this newsgroup, there is a greater
probability that someone can offer his/her help here.
First question:
Is it possible to use the __restrict__ qualifier on a member
variables, like in the example below (with gcc)?
class array {
double * __restrict__ data;
....
....
};
The compiler gives no error message, but does declaring data as
a__restrict__ed pointer have any effect on functions that accept
references to arrays as arguments?
The gcc documentation only mentions using __restrict__ on function
arguments or member functions. [1] In this case only the a single
function is affected.
Second question:
If this does not work, how can I achieve the same effect as with
void fun(double * __restrict__ arr1, double * __restrict__ arr2)
{ ... }
if I use array & instead of double *?
[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Restricted-Pointers.html#index-restricted-pointers-2455
official standard, but I got no reply on the gcc-help mailing list.
Since more people are reading this newsgroup, there is a greater
probability that someone can offer his/her help here.
First question:
Is it possible to use the __restrict__ qualifier on a member
variables, like in the example below (with gcc)?
class array {
double * __restrict__ data;
....
....
};
The compiler gives no error message, but does declaring data as
a__restrict__ed pointer have any effect on functions that accept
references to arrays as arguments?
The gcc documentation only mentions using __restrict__ on function
arguments or member functions. [1] In this case only the a single
function is affected.
Second question:
If this does not work, how can I achieve the same effect as with
void fun(double * __restrict__ arr1, double * __restrict__ arr2)
{ ... }
if I use array & instead of double *?
[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Restricted-Pointers.html#index-restricted-pointers-2455