From c16582003fb3a52e528f0a415e932c2e869e9952 Mon Sep 17 00:00:00 2001 From: Kazantsev Date: Fri, 14 Sep 2018 12:29:26 +0100 Subject: CPU modules fixed for big data --- Core/inpainters_CPU/Diffusion_Inpaint_core.c | 32 ++++---- Core/inpainters_CPU/Diffusion_Inpaint_core.h | 9 ++- .../inpainters_CPU/NonlocalMarching_Inpaint_core.c | 2 +- Core/regularisers_CPU/Diffus4th_order_core.c | 22 +++--- Core/regularisers_CPU/Diffus4th_order_core.h | 8 +- Core/regularisers_CPU/Diffusion_core.c | 26 +++---- Core/regularisers_CPU/Diffusion_core.h | 8 +- Core/regularisers_CPU/FGP_TV_core.c | 61 ++++++++-------- Core/regularisers_CPU/FGP_TV_core.h | 16 ++-- Core/regularisers_CPU/FGP_dTV_core.c | 85 +++++++++++----------- Core/regularisers_CPU/FGP_dTV_core.h | 24 +++--- Core/regularisers_CPU/LLT_ROF_core.c | 53 +++++++------- Core/regularisers_CPU/LLT_ROF_core.h | 14 ++-- Core/regularisers_CPU/ROF_TV_core.c | 37 +++++----- Core/regularisers_CPU/ROF_TV_core.h | 11 +-- Core/regularisers_CPU/SB_TV_core.c | 73 ++++++++++--------- Core/regularisers_CPU/SB_TV_core.h | 18 ++--- Core/regularisers_CPU/TGV_core.c | 59 +++++++-------- Core/regularisers_CPU/TGV_core.h | 15 ++-- Core/regularisers_CPU/TNV_core.c | 69 +++++++++--------- Core/regularisers_CPU/TNV_core.h | 8 +- Core/regularisers_CPU/utils.c | 18 ++--- Core/regularisers_CPU/utils.h | 2 +- Wrappers/Matlab/mex_compile/compileCPU_mex_Linux.m | 2 +- 24 files changed, 339 insertions(+), 333 deletions(-) diff --git a/Core/inpainters_CPU/Diffusion_Inpaint_core.c b/Core/inpainters_CPU/Diffusion_Inpaint_core.c index 56e0421..08b168a 100644 --- a/Core/inpainters_CPU/Diffusion_Inpaint_core.c +++ b/Core/inpainters_CPU/Diffusion_Inpaint_core.c @@ -47,12 +47,12 @@ int signNDF_inc(float x) { float Diffusion_Inpaint_CPU_main(float *Input, unsigned char *Mask, float *Output, float lambdaPar, float sigmaPar, int iterationsNumb, float tau, int penaltytype, int dimX, int dimY, int dimZ) { - int i,pointsone; + long i, pointsone; float sigmaPar2; sigmaPar2 = sigmaPar/sqrt(2.0f); /* copy into output */ - copyIm(Input, Output, dimX, dimY, dimZ); + copyIm(Input, Output, (long)(dimX), (long)(dimY), (long)(dimZ)); pointsone = 0; for (i=0; i 4) break; /*storing old values*/ - copyIm(Output, Output_prev, dimX, dimY, 1); - copyIm(P1, P1_prev, dimX, dimY, 1); - copyIm(P2, P2_prev, dimX, dimY, 1); + copyIm(Output, Output_prev, (long)(dimY), (long)(dimZ), 1l); + copyIm(P1, P1_prev, (long)(dimY), (long)(dimZ), 1l); + copyIm(P2, P2_prev, (long)(dimY), (long)(dimZ), 1l); tk = tkp1; } if (printM == 1) printf("FGP-TV iterations stopped at iteration %i \n", ll); @@ -100,7 +101,7 @@ float TV_FGP_CPU_main(float *Input, float *Output, float lambdaPar, int iteratio else { /*3D case*/ float *Output_prev=NULL, *P1=NULL, *P2=NULL, *P3=NULL, *P1_prev=NULL, *P2_prev=NULL, *P3_prev=NULL, *R1=NULL, *R2=NULL, *R3=NULL; - DimTotal = dimX*dimY*dimZ; + DimTotal = (long)(dimX*dimY*dimZ); Output_prev = calloc(DimTotal, sizeof(float)); P1 = calloc(DimTotal, sizeof(float)); @@ -117,13 +118,13 @@ float TV_FGP_CPU_main(float *Input, float *Output, float lambdaPar, int iteratio for(ll=0; ll 4) break; /*storing old values*/ - copyIm(Output, Output_prev, dimX, dimY, dimZ); - copyIm(P1, P1_prev, dimX, dimY, dimZ); - copyIm(P2, P2_prev, dimX, dimY, dimZ); - copyIm(P3, P3_prev, dimX, dimY, dimZ); + copyIm(Output, Output_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(P1, P1_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(P2, P2_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(P3, P3_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); tk = tkp1; } if (printM == 1) printf("FGP-TV iterations stopped at iteration %i \n", ll); @@ -157,10 +158,10 @@ float TV_FGP_CPU_main(float *Input, float *Output, float lambdaPar, int iteratio return *Output; } -float Obj_func2D(float *A, float *D, float *R1, float *R2, float lambda, int dimX, int dimY) +float Obj_func2D(float *A, float *D, float *R1, float *R2, float lambda, long dimX, long dimY) { float val1, val2; - int i,j,index; + long i,j,index; #pragma omp parallel for shared(A,D,R1,R2) private(index,i,j,val1,val2) for(i=0; i 4) break; /*storing old values*/ - copyIm(Output, Output_prev, dimX, dimY, 1); - copyIm(P1, P1_prev, dimX, dimY, 1); - copyIm(P2, P2_prev, dimX, dimY, 1); + copyIm(Output, Output_prev, (long)(dimX), (long)(dimY), 1l); + copyIm(P1, P1_prev, (long)(dimX), (long)(dimY), 1l); + copyIm(P2, P2_prev, (long)(dimX), (long)(dimY), 1l); tk = tkp1; } if (printM == 1) printf("FGP-dTV iterations stopped at iteration %i \n", ll); @@ -113,7 +114,7 @@ float dTV_FGP_CPU_main(float *Input, float *InputRef, float *Output, float lambd else { /*3D case*/ float *Output_prev=NULL, *P1=NULL, *P2=NULL, *P3=NULL, *P1_prev=NULL, *P2_prev=NULL, *P3_prev=NULL, *R1=NULL, *R2=NULL, *R3=NULL, *InputRef_x=NULL, *InputRef_y=NULL, *InputRef_z=NULL; - DimTotal = dimX*dimY*dimZ; + DimTotal = (long)(dimX*dimY*dimZ); Output_prev = calloc(DimTotal, sizeof(float)); P1 = calloc(DimTotal, sizeof(float)); @@ -130,22 +131,22 @@ float dTV_FGP_CPU_main(float *Input, float *InputRef, float *Output, float lambd InputRef_z = calloc(DimTotal, sizeof(float)); /* calculate gradient field (smoothed) for the reference volume */ - GradNorm_func3D(InputRef, InputRef_x, InputRef_y, InputRef_z, eta, dimX, dimY, dimZ); + GradNorm_func3D(InputRef, InputRef_x, InputRef_y, InputRef_z, eta, (long)(dimX), (long)(dimY), (long)(dimZ)); /* begin iterations */ for(ll=0; ll 4) break; /*storing old values*/ - copyIm(Output, Output_prev, dimX, dimY, dimZ); - copyIm(P1, P1_prev, dimX, dimY, dimZ); - copyIm(P2, P2_prev, dimX, dimY, dimZ); - copyIm(P3, P3_prev, dimX, dimY, dimZ); + copyIm(Output, Output_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(P1, P1_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(P2, P2_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(P3, P3_prev, (long)(dimX), (long)(dimY), (long)(dimZ)); tk = tkp1; } if (printM == 1) printf("FGP-dTV iterations stopped at iteration %i \n", ll); @@ -184,9 +185,9 @@ float dTV_FGP_CPU_main(float *Input, float *InputRef, float *Output, float lambd /***************************2D Functions*****************************/ /********************************************************************/ -float GradNorm_func2D(float *B, float *B_x, float *B_y, float eta, int dimX, int dimY) +float GradNorm_func2D(float *B, float *B_x, float *B_y, float eta, long dimX, long dimY) { - int i,j,index; + long i,j,index; float val1, val2, gradX, gradY, magn; #pragma omp parallel for shared(B, B_x, B_y) private(i,j,index,val1,val2,gradX,gradY,magn) for(i=0; i 1) { #pragma omp parallel for shared (A, D1, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, NOMx_1,NOMy_1,NOMy_0,NOMz_1,NOMz_0,denom1,denom2,denom3,T1) @@ -232,10 +233,10 @@ float D1_func_ROF(float *A, float *D1, int dimX, int dimY, int dimZ) return *D1; } /* calculate differences 2 */ -float D2_func_ROF(float *A, float *D2, int dimX, int dimY, int dimZ) +float D2_func_ROF(float *A, float *D2, long dimX, long dimY, long dimZ) { float NOMx_1, NOMy_1, NOMx_0, NOMz_1, NOMz_0, denom1, denom2, denom3, T2; - int i,j,k,i1,i2,k1,j1,j2,k2,index; + long i,j,k,i1,i2,k1,j1,j2,k2,index; if (dimZ > 1) { #pragma omp parallel for shared (A, D2, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, NOMx_1, NOMy_1, NOMx_0, NOMz_1, NOMz_0, denom1, denom2, denom3, T2) @@ -297,10 +298,10 @@ float D2_func_ROF(float *A, float *D2, int dimX, int dimY, int dimZ) } /* calculate differences 3 */ -float D3_func_ROF(float *A, float *D3, int dimY, int dimX, int dimZ) +float D3_func_ROF(float *A, float *D3, long dimX, long dimY, long dimZ) { float NOMx_1, NOMy_1, NOMx_0, NOMy_0, NOMz_1, denom1, denom2, denom3, T3; - int index,i,j,k,i1,i2,k1,j1,j2,k2; + long index,i,j,k,i1,i2,k1,j1,j2,k2; #pragma omp parallel for shared (A, D3, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, NOMx_1, NOMy_1, NOMy_0, NOMx_0, NOMz_1, denom1, denom2, denom3, T3) for(j=0; j 1) D3_func(Output, D3, dimX, dimY, dimZ); - TV_kernel(D1, D2, D3, Output, Input, lambdaPar, tau, dimX, dimY, dimZ); + D1_func(Output, D1, (long)(dimX), (long)(dimY), (long)(dimZ)); + D2_func(Output, D2, (long)(dimX), (long)(dimY), (long)(dimZ)); + if (dimZ > 1) D3_func(Output, D3, (long)(dimX), (long)(dimY), (long)(dimZ)); + TV_kernel(D1, D2, D3, Output, Input, lambdaPar, tau, (long)(dimX), (long)(dimY), (long)(dimZ)); } free(D1);free(D2); free(D3); return *Output; } /* calculate differences 1 */ -float D1_func(float *A, float *D1, int dimX, int dimY, int dimZ) +float D1_func(float *A, float *D1, long dimX, long dimY, long dimZ) { float NOMx_1, NOMy_1, NOMy_0, NOMz_1, NOMz_0, denom1, denom2,denom3, T1; - int i,j,k,i1,i2,k1,j1,j2,k2,index; + long i,j,k,i1,i2,k1,j1,j2,k2,index; if (dimZ > 1) { #pragma omp parallel for shared (A, D1, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, NOMx_1,NOMy_1,NOMy_0,NOMz_1,NOMz_0,denom1,denom2,denom3,T1) @@ -138,10 +138,10 @@ float D1_func(float *A, float *D1, int dimX, int dimY, int dimZ) return *D1; } /* calculate differences 2 */ -float D2_func(float *A, float *D2, int dimX, int dimY, int dimZ) +float D2_func(float *A, float *D2, long dimX, long dimY, long dimZ) { float NOMx_1, NOMy_1, NOMx_0, NOMz_1, NOMz_0, denom1, denom2, denom3, T2; - int i,j,k,i1,i2,k1,j1,j2,k2,index; + long i,j,k,i1,i2,k1,j1,j2,k2,index; if (dimZ > 1) { #pragma omp parallel for shared (A, D2, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, NOMx_1, NOMy_1, NOMx_0, NOMz_1, NOMz_0, denom1, denom2, denom3, T2) @@ -155,8 +155,7 @@ float D2_func(float *A, float *D2, int dimX, int dimY, int dimZ) j1 = j + 1; if (j1 >= dimY) j1 = j-1; j2 = j - 1; if (j2 < 0) j2 = j+1; k1 = k + 1; if (k1 >= dimZ) k1 = k-1; - k2 = k - 1; if (k2 < 0) k2 = k+1; - + k2 = k - 1; if (k2 < 0) k2 = k+1; /* Forward-backward differences */ NOMx_1 = A[(dimX*dimY)*k + (j1)*dimX + i] - A[index]; /* x+ */ @@ -203,10 +202,10 @@ float D2_func(float *A, float *D2, int dimX, int dimY, int dimZ) } /* calculate differences 3 */ -float D3_func(float *A, float *D3, int dimY, int dimX, int dimZ) +float D3_func(float *A, float *D3, long dimX, long dimY, long dimZ) { float NOMx_1, NOMy_1, NOMx_0, NOMy_0, NOMz_1, denom1, denom2, denom3, T3; - int index,i,j,k,i1,i2,k1,j1,j2,k2; + long index,i,j,k,i1,i2,k1,j1,j2,k2; #pragma omp parallel for shared (A, D3, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, NOMx_1, NOMy_1, NOMy_0, NOMx_0, NOMz_1, denom1, denom2, denom3, T3) for(j=0; j 1) { #pragma omp parallel for shared (D1, D2, D3, B, dimX, dimY, dimZ) private(index, i, j, k, i1, j1, k1, i2, j2, k2, dv1,dv2,dv3) diff --git a/Core/regularisers_CPU/ROF_TV_core.h b/Core/regularisers_CPU/ROF_TV_core.h index 14daf58..4e320e9 100644 --- a/Core/regularisers_CPU/ROF_TV_core.h +++ b/Core/regularisers_CPU/ROF_TV_core.h @@ -46,11 +46,12 @@ limitations under the License. #ifdef __cplusplus extern "C" { #endif -CCPI_EXPORT float TV_kernel(float *D1, float *D2, float *D3, float *B, float *A, float lambda, float tau, int dimY, int dimX, int dimZ); CCPI_EXPORT float TV_ROF_CPU_main(float *Input, float *Output, float lambdaPar, int iterationsNumb, float tau, int dimX, int dimY, int dimZ); -CCPI_EXPORT float D1_func(float *A, float *D1, int dimY, int dimX, int dimZ); -CCPI_EXPORT float D2_func(float *A, float *D2, int dimY, int dimX, int dimZ); -CCPI_EXPORT float D3_func(float *A, float *D3, int dimY, int dimX, int dimZ); + +CCPI_EXPORT float TV_kernel(float *D1, float *D2, float *D3, float *B, float *A, float lambda, float tau, long dimX, long dimY, long dimZ); +CCPI_EXPORT float D1_func(float *A, float *D1, long dimX, long dimY, long dimZ); +CCPI_EXPORT float D2_func(float *A, float *D2, long dimX, long dimY, long dimZ); +CCPI_EXPORT float D3_func(float *A, float *D3, long dimX, long dimY, long dimZ); #ifdef __cplusplus } -#endif +#endif \ No newline at end of file diff --git a/Core/regularisers_CPU/SB_TV_core.c b/Core/regularisers_CPU/SB_TV_core.c index 06d3de3..769ea67 100755 --- a/Core/regularisers_CPU/SB_TV_core.c +++ b/Core/regularisers_CPU/SB_TV_core.c @@ -37,16 +37,17 @@ limitations under the License. float SB_TV_CPU_main(float *Input, float *Output, float mu, int iter, float epsil, int methodTV, int printM, int dimX, int dimY, int dimZ) { - int ll, j, DimTotal; + int ll; + long j, DimTotal; float re, re1, lambda; int count = 0; mu = 1.0f/mu; - lambda = 2.0f*mu; + lambda = 2.0f*mu; if (dimZ <= 1) { /* 2D case */ float *Output_prev=NULL, *Dx=NULL, *Dy=NULL, *Bx=NULL, *By=NULL; - DimTotal = dimX*dimY; + DimTotal = (long)(dimX*dimY); Output_prev = calloc(DimTotal, sizeof(float)); Dx = calloc(DimTotal, sizeof(float)); @@ -54,26 +55,26 @@ float SB_TV_CPU_main(float *Input, float *Output, float mu, int iter, float epsi Bx = calloc(DimTotal, sizeof(float)); By = calloc(DimTotal, sizeof(float)); - copyIm(Input, Output, dimX, dimY, 1); /*initialize */ + copyIm(Input, Output, (long)(dimX), (long)(dimY), 1l); /*initialize */ /* begin outer SB iterations */ for(ll=0; ll divergence and projection of P*/ - DivProjP_2D(U, U0, P1, P2, dimX, dimY, lambda, tau); + DivProjP_2D(U, U0, P1, P2, (long)(dimX), (long)(dimY), lambda, tau); /*get updated solution U*/ - newU(U, U_old, dimX, dimY); + newU(U, U_old, (long)(dimX), (long)(dimY)); /*saving V into V_old*/ - copyIm(V1, V1_old, dimX, dimY, 1); - copyIm(V2, V2_old, dimX, dimY, 1); + copyIm(V1, V1_old, (long)(dimX), (long)(dimY), 1l); + copyIm(V2, V2_old, (long)(dimX), (long)(dimY), 1l); /* upd V*/ - UpdV_2D(V1, V2, P1, P2, Q1, Q2, Q3, dimX, dimY, tau); + UpdV_2D(V1, V2, P1, P2, Q1, Q2, Q3, (long)(dimX), (long)(dimY), tau); /*get new V*/ - newU(V1, V1_old, dimX, dimY); - newU(V2, V2_old, dimX, dimY); + newU(V1, V1_old, (long)(dimX), (long)(dimY)); + newU(V2, V2_old, (long)(dimX), (long)(dimY)); } /*end of iterations*/ return *U; } @@ -107,9 +108,9 @@ float TGV_main(float *U0, float *U, float lambda, float alpha1, float alpha0, in /********************************************************************/ /*Calculating dual variable P (using forward differences)*/ -float DualP_2D(float *U, float *V1, float *V2, float *P1, float *P2, int dimX, int dimY, float sigma) +float DualP_2D(float *U, float *V1, float *V2, float *P1, float *P2, long dimX, long dimY, float sigma) { - int i,j, index; + long i,j, index; #pragma omp parallel for shared(U,V1,V2,P1,P2) private(i,j,index) for(i=0; i 1) sigma = (beta * sigma) / b; alpha = alpha0; - copyIm(u, u_upd, dimX, dimY, dimZ); - copyIm(gx, gx_upd, dimX, dimY, dimZ); - copyIm(gy, gy_upd, dimX, dimY, dimZ); - copyIm(qx, qx_upd, dimX, dimY, dimZ); - copyIm(qy, qy_upd, dimX, dimY, dimZ); - copyIm(gradx, gradx_upd, dimX, dimY, dimZ); - copyIm(grady, grady_upd, dimX, dimY, dimZ); - copyIm(div, div_upd, dimX, dimY, dimZ); + copyIm(u, u_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(gx, gx_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(gy, gy_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(qx, qx_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(qy, qy_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(gradx, gradx_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(grady, grady_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); + copyIm(div, div_upd, (long)(dimX), (long)(dimY), (long)(dimZ)); } else if(resprimal > dual_dot_delta) { @@ -205,14 +205,14 @@ taulambda = tau * lambda; divsigma = 1.0f / sigma; divtau = 1.0f / tau; -copyIm(u_upd, u, dimX, dimY, dimZ); -copyIm(gx_upd, gx, dimX, dimY, dimZ); -copyIm(gy_upd, gy, dimX, dimY, dimZ); -copyIm(qx_upd, qx, dimX, dimY, dimZ); -copyIm(qy_upd, qy, dimX, dimY, dimZ); -copyIm(gradx_upd, gradx, dimX, dimY, dimZ); -copyIm(grady_upd, grady, dimX, dimY, dimZ); -copyIm(div_upd, div, dimX, dimY, dimZ); +copyIm(u_upd, u, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(gx_upd, gx, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(gy_upd, gy, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(qx_upd, qx, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(qy_upd, qy, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(gradx_upd, gradx, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(grady_upd, grady, (long)(dimX), (long)(dimY), (long)(dimZ)); +copyIm(div_upd, div, (long)(dimX), (long)(dimY), (long)(dimZ)); // Compute residual at current iteration residual = (resprimal + resdual) / ((float) (dimX*dimY*dimZ)); @@ -227,15 +227,14 @@ if (residual < tol) { free (u_upd); free(gx); free(gy); free(gx_upd); free(gy_upd); free(qx); free(qy); free(qx_upd); free(qy_upd); free(v); free(vx); free(vy); free(gradx); free(grady); free(gradx_upd); free(grady_upd); free(gradx_ubar); - free(grady_ubar); free(div); free(div_upd); - + free(grady_ubar); free(div); free(div_upd); return *u; } -float proxG(float *u_upd, float *v, float *f, float taulambda, int dimX, int dimY, int dimZ) +float proxG(float *u_upd, float *v, float *f, float taulambda, long dimX, long dimY, long dimZ) { float constant; - int k; + long k; constant = 1.0f + taulambda; #pragma omp parallel for shared(v, f, u_upd) private(k) for(k=0; k 1.0f) { @@ -424,9 +423,9 @@ float proxF(float *gx, float *gy, float *vx, float *vy, float sigma, int p, int return 1; } -float divergence(float *qx_upd, float *qy_upd, float *div_upd, int dimX, int dimY, int dimZ) +float divergence(float *qx_upd, float *qy_upd, float *div_upd, long dimX, long dimY, long dimZ) { - int i, j, k, l; + long i, j, k, l; #pragma omp parallel for shared(qx_upd,qy_upd,div_upd) private(i, j, k, l) for(k = 0; k < dimZ; k++) { for(j = 0; j < dimY; j++) { diff --git a/Core/regularisers_CPU/TNV_core.h b/Core/regularisers_CPU/TNV_core.h index c082694..aa050a4 100644 --- a/Core/regularisers_CPU/TNV_core.h +++ b/Core/regularisers_CPU/TNV_core.h @@ -38,10 +38,10 @@ extern "C" { CCPI_EXPORT float TNV_CPU_main(float *Input, float *u, float lambda, int maxIter, float tol, int dimX, int dimY, int dimZ); /*float PDHG(float *A, float *B, float tau, float sigma, float theta, float lambda, int p, int q, int r, float tol, int maxIter, int d_c, int d_w, int d_h);*/ -CCPI_EXPORT float proxG(float *u_upd, float *v, float *f, float taulambda, int dimX, int dimY, int dimZ); -CCPI_EXPORT float gradient(float *u_upd, float *gradx_upd, float *grady_upd, int dimX, int dimY, int dimZ); -CCPI_EXPORT float proxF(float *gx, float *gy, float *vx, float *vy, float sigma, int p, int q, int r, int dimX, int dimY, int dimZ); -CCPI_EXPORT float divergence(float *qx_upd, float *qy_upd, float *div_upd, int dimX, int dimY, int dimZ); +CCPI_EXPORT float proxG(float *u_upd, float *v, float *f, float taulambda, long dimX, long dimY, long dimZ); +CCPI_EXPORT float gradient(float *u_upd, float *gradx_upd, float *grady_upd, long dimX, long dimY, long dimZ); +CCPI_EXPORT float proxF(float *gx, float *gy, float *vx, float *vy, float sigma, int p, int q, int r, long dimX, long dimY, long dimZ); +CCPI_EXPORT float divergence(float *qx_upd, float *qy_upd, float *div_upd, long dimX, long dimY, long dimZ); #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/Core/regularisers_CPU/utils.c b/Core/regularisers_CPU/utils.c index 3eebdaa..7a4e80b 100644 --- a/Core/regularisers_CPU/utils.c +++ b/Core/regularisers_CPU/utils.c @@ -21,9 +21,9 @@ limitations under the License. #include /* Copy Image (float) */ -float copyIm(float *A, float *U, int dimX, int dimY, int dimZ) +float copyIm(float *A, float *U, long dimX, long dimY, long dimZ) { - int j; + long j; #pragma omp parallel for shared(A, U) private(j) for (j = 0; j