4 Replies Latest reply on Nov 25, 2013 12:58 AM by evancheng

    Crash after set new plan length

    evancheng

      I found I can not make the program work after changing the FFT plan length.

      In my case the length of two dimensions are different, and compare to the cufft, the dimension need to reversed for AmdFft to get the same result.

      EX:

      cufft:  cufftPlan2d(&fftplan, 64, 32, CUFFT_C2C);

      amdfft:

      size_t clLengths[3] = {32, 64, 1};

      clAmdFftCreateDefaultPlan( &fftPlan, context, CLFFT_2D, clLengths );

       

      I'm not sure it's related or not, any one know how to solve it ??

       

      size_t clLengths[3] = {32, 64, 1};

      clAmdFftCreateDefaultPlan( &fftPlan, context, CLFFT_2D, clLengths );

      clAmdFftSetResultLocation( fftPlan, CLFFT_OUTOFPLACE );

      clAmdFftSetLayout( fftPlan, CLFFT_COMPLEX_INTERLEAVED, CLFFT_COMPLEX_INTERLEAVED );

      clAmdFftSetPlanBatchSize( fftPlan, 1 );

      clAmdFftSetPlanScale(fftPlan, CLFFT_BACKWARD, 1.0);

      clAmdFftBakePlan( fftPlan, 1, &queue, NULL, NULL );

       

      size_t buffersize=0;

      clAmdFftGetTmpBufSize( fftPlan, &buffersize );

      if (buffersize)

      {

          cl_int medstatus;

          fftTmpBuffer = clCreateBuffer ( context, CL_MEM_READ_WRITE, buffersize, 0, &medstatus);

      }

       

      // then run clAmdFftEnqueueTransform() can get correct result

       

      // allocate new arrays and prepare for next fft

      size_t clLengths[3] = {64, 128, 1};

      clAmdFftSetPlanLength( fftPlan, CLFFT_2D, clLengths);

      clAmdFftBakePlan( fftPlan, 1, &queue, NULL, NULL );

       

      if (fftTmpBuffer)

          clReleaseMemObject(fftTmpBuffer);

      size_t buffersize=0;

      clAmdFftGetTmpBufSize( fftPlan, &buffersize );

      if (buffersize)

      {

          cl_int medstatus;

          fftTmpBuffer = clCreateBuffer ( context, CL_MEM_READ_WRITE, buffersize, 0, &medstatus);

      }

       

      // then will crash when call clAmdFftEnqueueTransform()