CUFFT under DRIVER API

Hi room, actually am having a problem in using CUFFT library with Diver API. The program runs well until cufftExecC2R. I got an error message that says EXEC_FAILED. I dont really know where the problem is. I use cuCtxSynchronize() before and after calling the inverse FFT. I also use casting for d_ht and d_h0 (which are declared CUdeviceptr and must be respectively (cufftComplex*) and (cufftReal*))…

CUdeviceptr d_h0 = 0, d_slope = 0, d_ht = 0;

void runCuda()
{
// generate wave spectrum in frequency domain
CU_SAFE_CALL( cuFuncSetBlockShape( transform[0], 8, 8, 1 ));
int offset = 0;
CU_SAFE_CALL( cuParamSeti(transform[0], offset, d_h0)); offset += sizeof(d_h0);
CU_SAFE_CALL( cuParamSeti(transform[0], offset, d_ht)); offset += sizeof(d_ht);
CU_SAFE_CALL( cuParamSeti(transform[0], offset, fftInputW)); offset += sizeof(fftInputW);
CU_SAFE_CALL( cuParamSeti(transform[0], offset, fftInputH)); offset += sizeof(fftInputH);
CU_SAFE_CALL( cuParamSetf(transform[0], offset, animTime)); offset += sizeof(animTime);
CU_SAFE_CALL( cuParamSetf(transform[0], offset, patchSize)); offset += sizeof(patchSize);
CU_SAFE_CALL( cuParamSetSize(transform[0], offset));
CU_SAFE_CALL( cuLaunchGrid( transform[0], iDivUp(fftInputW, 8), iDivUp(fftInputH, 8)) );
cuCtxSynchronize();

// execute inverse FFT to convert to spatial domain
CUdeviceptr hptr;
unsigned int size =  meshW*meshH*sizeof(float);
CU_SAFE_CALL( cuGLMapBufferObject(&hptr,&size, heightVertexBuffer));
CUFFT_SAFE_CALL( cufftExecC2R(fftPlan, (cufftComplex*)&d_ht, (cufftReal*)&hptr));
cuCtxSynchronize();

}

Any help would be appreciated… Thanx a lot…

Hochman…

No answer? Thanx anyway… now it works… u know what, now I use

CUFFT_SAFE_CALL( cufftExecC2R(fftPlan, (cufftComplex*)d_ht, (cufftReal*)hptr));

instead of

CUFFT_SAFE_CALL( cufftExecC2R(fftPlan, (cufftComplex*)&d_ht, (cufftReal*)&hptr));

I didnt pay attention to the & symbol… d_ht and hptr are declared CUdeviceptr (pointers in reality)…

thank u so much…

Synchronizing context is not required in reality…