Prechádzať zdrojové kódy

tests/datawizard/scal: define functions in scal.h to reuse them in other places

Nathalie Furmento 13 rokov pred
rodič
commit
0c13e9ae90
2 zmenil súbory, kde vykonal 14 pridanie a 6 odobranie
  1. 3 6
      tests/datawizard/scal.c
  2. 11 0
      tests/datawizard/scal.h

+ 3 - 6
tests/datawizard/scal.c

@@ -16,8 +16,9 @@
 
 #include <starpu.h>
 #include <starpu_opencl.h>
+#include "scal.h"
 
-static void scal_func_cpu(void *buffers[], void *cl_arg)
+void scal_func_cpu(void *buffers[], void *cl_arg)
 {
 	unsigned i;
 
@@ -30,14 +31,10 @@ static void scal_func_cpu(void *buffers[], void *cl_arg)
 		val[i] *= 2;
 }
 
-#ifdef STARPU_USE_CUDA
-extern void scal_func_cuda(void *buffers[], void *cl_arg);
-#endif
-
 #ifdef STARPU_USE_OPENCL
 struct starpu_opencl_program opencl_program;
 
-static void scal_func_opencl(void *buffers[], void *_args)
+void scal_func_opencl(void *buffers[], void *_args)
 {
 	int id, devid;
         cl_int err;

+ 11 - 0
tests/datawizard/scal.h

@@ -18,3 +18,14 @@
 
 extern struct starpu_codelet scal_codelet;
 extern struct starpu_opencl_program opencl_program;
+
+void scal_func_cpu(void *buffers[], void *cl_arg);
+
+#ifdef STARPU_USE_CUDA
+void scal_func_cuda(void *buffers[], void *cl_arg);
+#endif
+
+#ifdef STARPU_USE_OPENCL
+void scal_func_opencl(void *buffers[], void *_args);
+#endif
+