Commit 5a66c9c4 authored by Henning Fehrmann's avatar Henning Fehrmann Committed by Henning Fehrmann
Browse files

make fftw platform agnostic

parent 2d650dd1
......@@ -46,10 +46,9 @@ run_test
}
// Copy data to device
hipMemcpy(A, hA, sizeof(*hA) * N, hipMemcpyHostToDevice);
__ASSERT(__PREFIX(Memcpy)(A, hA, sizeof(*hA) * N, __PREFIX(MemcpyHostToDevice)));
// Create FFT plan
__FFTW_PLAN plan = NULL;
__FFTW_PLAN plan;
size_t length = N;
char mes[128];
......@@ -80,14 +79,16 @@ run_test
#ifdef ROC
rocfft_execute(plan, (void**) &A, NULL, NULL);
#elif CUDA
cufftExecC2C(plan, A, A);
cufftExecC2C(plan,A , A, CUFFT_FORWARD);
#endif
timer_stop(timer);
// Wait for execution to finish
sprintf(mes, "dim: %zu\tSynchronize round %d." ,N , r);
timer_start(timer, mes);
#ifdef ROC
hipDeviceSynchronize();
#endif
timer_stop(timer);
}
// Destroy plan
......@@ -96,7 +97,7 @@ run_test
__DESTROY_PLAN(plan);
timer_stop(timer);
__ASSERT(__PREFIX(Memcpy)(hB, A, sizeof(*A) * N, hipMemcpyDeviceToHost));
__ASSERT(__PREFIX(Memcpy)(hB, A, sizeof(*A) * N, __PREFIX(MemcpyDeviceToHost)));
__ASSERT(__PREFIX(Free)(A));
free(hA);
......@@ -111,7 +112,7 @@ main
)
{
int rep = 1;
int min_dim = 12;
int min_dim = 8;
int max_dim = 28;
int nofftws = 128;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment