aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/fft/generate.c
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-06-12 13:19:18 +0100
committerYann Herklotz <git@yannherklotz.com>2020-06-12 13:19:18 +0100
commitda1b679c68c06ce1cf59df7706dcc59036872269 (patch)
tree37e2f899b717df444fd12cd5e6715b0de2aa69d2 /benchmarks/fft/generate.c
parent0f9ab38389000edfa2376fabace69d2366d32647 (diff)
parent16da832b98deb028fe8248ed8ed29bfddb477124 (diff)
downloadvericert-kvx-da1b679c68c06ce1cf59df7706dcc59036872269.tar.gz
vericert-kvx-da1b679c68c06ce1cf59df7706dcc59036872269.zip
Merge branch 'master' of github.com:ymherklotz/CoqUp
Diffstat (limited to 'benchmarks/fft/generate.c')
-rw-r--r--benchmarks/fft/generate.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/benchmarks/fft/generate.c b/benchmarks/fft/generate.c
new file mode 100644
index 0000000..f5135e2
--- /dev/null
+++ b/benchmarks/fft/generate.c
@@ -0,0 +1,43 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+#include "fft.h"
+// Fake benchmark function to satisfy the extern
+void fft1D_512(double data_x[512], double data_y[512]){ }
+
+void generate_binary()
+{
+ struct bench_args_t data;
+ char *ptr;
+ int status, i, fd, written=0;
+
+ // Fill data structure
+ srandom(1);
+ for(i=0; i<512; i++){
+ data.work_x[i] = (double)random();
+ data.work_y[i] = (double)random();
+ }
+
+ // Open and write
+ fd = open("input.data", O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+ assert( fd>0 && "Couldn't open input data file" );
+
+ ptr = (char *) &data;
+ while( written<sizeof(data) ) {
+ status = write( fd, ptr, sizeof(data)-written );
+ assert( status>=0 && "Couldn't write input data file" );
+ written += status;
+ }
+}
+
+int main(int argc, char **argv)
+{
+ generate_binary();
+ return 0;
+} \ No newline at end of file