@@ -309,11 +309,15 @@ int init(Grid &par){
309309 (unsigned int )xDim, (unsigned int )yDim);
310310 exit (1 );
311311 }
312- generate_plan_other2d (&plan_other2d, par);
313312
314313 generate_plan_other3d (&plan_1d, par, 0 );
315- generate_plan_other3d (&plan_dim2, par, 1 );
316- generate_plan_other3d (&plan_dim3, par, 2 );
314+ if (dimnum == 2 ){
315+ generate_plan_other3d (&plan_dim2, par, 1 );
316+ }
317+ if (dimnum == 3 ){
318+ generate_plan_other3d (&plan_dim3, par, 2 );
319+ generate_plan_other2d (&plan_other2d, par);
320+ }
317321 result = cufftPlan3d (&plan_3d, xDim, yDim, zDim, CUFFT_Z2Z);
318322 if (result != CUFFT_SUCCESS){
319323 printf (" Result:=%d\n " ,result);
@@ -526,7 +530,6 @@ void set_variables(Grid &par, bool ev_type){
526530
527531 // Special variables / instructions for 2/3d case
528532 if (dimnum > 1 && !par.bval (" Ay_time" )){
529- pAy_gpu = par.cufftDoubleComplexval (" pAy_gpu" );
530533 EpAy = par.cufftDoubleComplexval (" EpAy" );
531534 err=cudaMemcpy (pAy_gpu, EpAy, sizeof (cufftDoubleComplex)*gsize,
532535 cudaMemcpyHostToDevice);
@@ -538,7 +541,6 @@ void set_variables(Grid &par, bool ev_type){
538541 }
539542
540543 if (dimnum > 2 && !par.bval (" Az_time" )){
541- pAz_gpu = par.cufftDoubleComplexval (" pAz_gpu" );
542544 EpAz = par.cufftDoubleComplexval (" EpAz" );
543545 err=cudaMemcpy (pAz_gpu, EpAz, sizeof (cufftDoubleComplex)*gsize,
544546 cudaMemcpyHostToDevice);
0 commit comments