Explorar el Código

Add history model to vector scal, to have an example with all of cpu, cuda and opencl

Samuel Thibault hace 14 años
padre
commit
bcb03da8a8
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      examples/basic_examples/vector_scal.c

+ 8 - 1
examples/basic_examples/vector_scal.c

@@ -24,6 +24,7 @@
 
 #include <starpu.h>
 #include <starpu_opencl.h>
+#include <stdio.h>
 
 #define	NX	2048
 
@@ -31,6 +32,11 @@ extern void scal_cpu_func(void *buffers[], void *_args);
 extern void scal_cuda_func(void *buffers[], void *_args);
 extern void scal_opencl_func(void *buffers[], void *_args);
 
+static struct starpu_perfmodel_t vector_scal_model = {
+	.type = STARPU_HISTORY_BASED,
+	.symbol = "vector_scale_model"
+};
+
 static starpu_codelet cl = {
 	.where = STARPU_CPU | STARPU_CUDA | STARPU_OPENCL,
 	/* CPU implementation of the codelet */
@@ -43,7 +49,8 @@ static starpu_codelet cl = {
 	/* OpenCL implementation of the codelet */
 	.opencl_func = scal_opencl_func,
 #endif
-	.nbuffers = 1
+	.nbuffers = 1,
+	.model = &vector_scal_model
 };
 
 #ifdef STARPU_USE_OPENCL