[b]Fixed!
My mistake: I updated Cuda Toolkit to 4.1 but don’t update driver.
After update driver all works OK
[/b]
I tested CUFFT in “driver API”
It works OK in windows XP , but when i try run application in new windows
it don’t work.
It is my test application, what is problem ?
cuFFT works in “Driver API” ?
// includes, system
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
// includes, project
#include <cuda.h>
#include <cufft.h>
int testError(int p_fu)
{
printf("Error = %d\n",p_fu);
return p_fu;
}
////////////////////////////////////////////////////////////////////////////////
// Program main
////////////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv)
{
int new_size = 4096;
int error=0;
int i;
cuComplex tab[4096];
cuComplex tab2[4096];
for(i=0; i<4096;i++)
{
tab[i].x = float(i);
tab[i].y = 0;
tab2[i].x = 0.0;
tab2[i].y = 0.0;
}
CUdevice hDevice=0;
CUdeviceptr device_a=0;
CUdeviceptr device_b=0;
CUdeviceptr device_c=0;
CUcontext hContext=0;
cuInit(0);
cuDeviceGet( &hDevice ,0);
cuCtxCreate( &hContext, 0,hDevice);
error = testError(cuMemAlloc(&device_a,sizeof(cufftComplex)*4096));
error = testError(cuMemAlloc(&device_b,sizeof(cufftComplex)*4096));
error = testError(cuMemAlloc(&device_c,sizeof(cufftComplex)*4096));
error = testError(cuMemcpyHtoD(device_a, &tab[0], sizeof(cufftComplex)*4096));
// CUFFT plan
cufftHandle plan;
error = testError(cufftPlan1d(&plan, new_size, CUFFT_C2C, 1));
error = testError(cufftExecC2C( plan, (cufftComplex *)device_a, (cufftComplex *)device_b, CUFFT_FORWARD));
error = testError(cufftExecC2C( plan,(cufftComplex *)device_b, (cufftComplex *)device_c, CUFFT_INVERSE));
error = testError(cuMemcpyDtoH(&tab2[0],device_c, sizeof(cufftComplex)*4096));
for(i=0; i<4096;i++)
{
printf("[%d] %f ",i, tab2[i].x / 4096);
}
return 0;
}