Hi All.
Restrict in structure does not seem to work. Is this supposed to be supported ?
Let me give a simple example code:
typedef struct
{
float *restrict pipo1;
float *restrict pipo2;
float *restrict pipo3;
}MyStruct;
void main()
{
int i;
MyStruct* st = malloc(sizeof(MyStruct));
st->pipo1 = malloc(256*4);
st->pipo2 = malloc(256*4);
st->pipo3 = malloc(256*4);
_nassert ( (int) st->pipo1 %8 == 0 );
_nassert ( (int) st->pipo2 %8 == 0 );
_nassert ( (int) st->pipo3 %8 == 0 );
#pragma MUST_ITERATE(256,,8)
#pragma UNROLL(2)
for (i=0; i<256; i++) // First Loop
st->pipo3[i]=st->pipo1[i]+st->pipo2[i];
float *restrict cpipo1 = st->pipo1;
float *restrict cpipo2 = st->pipo2;
float *restrict cpipo3 = st->pipo3;
_nassert ( (int) cpipo1 %8 == 0 );
_nassert ( (int) cpipo2 %8 == 0 );
_nassert ( (int) cpipo3 %8 == 0 );
#pragma MUST_ITERATE(256,,8)
#pragma UNROLL(2)
for (i=0; i<256; i++) //Second Loop
cpipo3[i]=cpipo1[i]+cpipo2[i];
}
First Loop : iii = 3 Schedule found with 4 iterations in parallel , Unroll (4x)
Second Loop: ii = 2 Schedule found with 6 iterations in parallel, Unroll(4x)
To Optimize My code I have to work with copy of pointer with restrict qualifier.
I am in Release Configuration : Symbolic debug for program analysis, Optimization level 3, Optmize fully in the presence of debug directives
Regards ,
Pierre
