Commit 6c831c1c authored by Claudio Gheller's avatar Claudio Gheller
Browse files

bug fix on nbucket

parent a3badff9
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ __global__ void phase_g(int xaxis,
	double add_term_real;
	double add_term_real;
	double add_term_img;
	double add_term_img;
	double wterm;
	double wterm;
	long arraysize = (long)((xaxis*yaxis*num_w_planes)/nbucket + 1);
	long arraysize = (long)((xaxis*yaxis*num_w_planes)/nbucket);


	if(gid < arraysize)
	if(gid < arraysize)
	{
	{
@@ -95,7 +95,8 @@ void phase_correction(double* gridss, double* image_real, double* image_imag, in


#ifdef __CUDACC__
#ifdef __CUDACC__


	int nbucket = 32;
	// WARNING: nbucket MUST be chosen such that xaxis*yaxis*num_w_planes is a multiple of nbucket
	int nbucket = 1;
        int Nth = NTHREADS;
        int Nth = NTHREADS;
        long Nbl = (long)((num_w_planes*xaxis*yaxis)/Nth/nbucket) + 1;
        long Nbl = (long)((num_w_planes*xaxis*yaxis)/Nth/nbucket) + 1;
        if(NWORKERS == 1) {Nbl = 1; Nth = 1;};
        if(NWORKERS == 1) {Nbl = 1; Nth = 1;};