SVD with MPI+CUDA Program to solve linear equations by SVD with MPI+CUDA

Hello! I have my program that solve linear equations by SVD with MPI. Haw can I rewrite it for GPU with CUDA with MPI? Help me please! :">

Hello! I have my program that solve linear equations by SVD with MPI. Haw can I rewrite it for GPU with CUDA with MPI? Help me please! :">

How can I rewrite function for cuda? Possible anything help me External Image

double Scal (int n, double* x, double* y )
{ int i,m, sc=5;
double prod;
m = n%sc; prod = 0.0;
for( i=0; i<m; i++ ) prod += x[i]*y[i];
for( ; i<n; i+=sc ) prod += x[i]*y[i]+x[i+1]*y[i+1]+x[i+2]*y[i+2]+x[i+3]*y[i+3]+x[i+4]*y
[i+4];
return(prod);
}

How can I rewrite function for cuda? Possible anything help me External Image

double Scal (int n, double* x, double* y )
{ int i,m, sc=5;
double prod;
m = n%sc; prod = 0.0;
for( i=0; i<m; i++ ) prod += x[i]*y[i];
for( ; i<n; i+=sc ) prod += x[i]*y[i]+x[i+1]*y[i+1]+x[i+2]*y[i+2]+x[i+3]*y[i+3]+x[i+4]*y
[i+4];
return(prod);
}