aboutsummaryrefslogtreecommitdiff
path: root/samples/OpenCL
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OpenCL')
-rw-r--r--samples/OpenCL/fft.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/samples/OpenCL/fft.cl b/samples/OpenCL/fft.cl
new file mode 100644
index 0000000..e18c6e0
--- /dev/null
+++ b/samples/OpenCL/fft.cl
@@ -0,0 +1,13 @@
+double run_fftw(int n,const float * x,float * y)
+{
+ fftwf_plan p1 = fftwf_plan_dft_1d(n,(fftwf_complex *)x,(fftwf_complex *)y,
+ FFTW_FORWARD,FFTW_ESTIMATE);
+ const int nops = 10;
+ double t = cl::realTime();
+ for (int op = 0;op < nops;op++) {
+ fftwf_execute(p1);
+ }
+ t = (cl::realTime() - t)/(double)nops;
+ fftwf_destroy_plan(p1);
+ return t;
+}