I need to implement SSE (vector operations) to this C module, but cannot reach enough information of this technology, any clue or solution for this?
Also, i'm listening if you have any tips for the code here.
void evolution(void *u, int w, int h){
//check_args(c, v);
unsigned (*univ)[w] = u;
unsigned new[h][w];
int itis = args.ITERATIONS;
int actualIteration = 0;
while(itis>0){
int thisGenerationSeeds = 0;
for(int y=0;y for(int x=0;x int n = 0;
for(int y1=y-1;y1<=y+1;y1++){
for(int x1=x-1;x1<=x+1;x1++){
if(univ[(y1+h)%h][(x1+w)%w]){
n++;
thisGenerationSeeds++;
}
}
}
if(univ[y][x]==1){
n--;
}
new[y][x] = (n==3 || (n==2 && univ[y][x]));
//thisGenerationSeeds++ = (n==3 || (n==2 && univ[y][x]));
}
}
itis--;
actualIteration++;
printf("\nIteration:_%d, \n Sec Living Seeds:_%d,\n Par Living Seeds:,\n Vec Living Seeds%d",actualIteration, thisGeneration
}
for(int y=0;y for(int x=0;x univ[y][x] = new[y][x];
}
}
}
No comments:
Post a Comment