This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using PLD for strided access to an array

Given the following code that is accessing the columns of a matrix layer out in row major order, I want to include a prefetch so that I do not have misses on each column component.
Cam you tell me where to put the prefetch and it's syntax? I have been working with a student who has no understanding of strided DMAs and I need to get this working to increase performance. I do research on creating normal forms for algorithms and using C interfaces to hardware to avoid "magic" done in compilers.

void khatrirao(double *C, double *A, double *B, int nmax, int mmax, int pmax, int npmax) { int i,k,l; for (i=0;i<nmax;i++) { for (k=0;k<mmax;k++) { for (l=0;l<pmax;l++) { C[i+(nmax*((k*pmax)+l))]=A[i+(nmax*k)]*B[i+(nmax*l)]; }}} }