|
@@ -32,7 +32,8 @@
|
|
|
|
|
|
|
|
|
|
/* Counting the calls to the codelets */
|
|
/* Counting the calls to the codelets */
|
|
-struct stats {
|
|
|
|
|
|
+struct stats
|
|
|
|
+{
|
|
unsigned int cpu;
|
|
unsigned int cpu;
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
unsigned int cuda;
|
|
unsigned int cuda;
|
|
@@ -62,13 +63,15 @@ static void cuda_to_cpu_func(void *buffers[], void *args)
|
|
global_stats.cuda_to_cpu++;
|
|
global_stats.cuda_to_cpu++;
|
|
}
|
|
}
|
|
|
|
|
|
-struct starpu_codelet cpu_to_cuda_cl = {
|
|
|
|
|
|
+struct starpu_codelet cpu_to_cuda_cl =
|
|
|
|
+{
|
|
.where = STARPU_CUDA,
|
|
.where = STARPU_CUDA,
|
|
.cuda_funcs = {cpu_to_cuda_func, NULL},
|
|
.cuda_funcs = {cpu_to_cuda_func, NULL},
|
|
.nbuffers = 1
|
|
.nbuffers = 1
|
|
};
|
|
};
|
|
|
|
|
|
-struct starpu_codelet cuda_to_cpu_cl = {
|
|
|
|
|
|
+struct starpu_codelet cuda_to_cpu_cl =
|
|
|
|
+{
|
|
.where = STARPU_CPU,
|
|
.where = STARPU_CPU,
|
|
.cpu_funcs = {cuda_to_cpu_func, NULL},
|
|
.cpu_funcs = {cuda_to_cpu_func, NULL},
|
|
.nbuffers = 1
|
|
.nbuffers = 1
|
|
@@ -88,20 +91,23 @@ static void opencl_to_cpu_func(void *buffers[], void *args)
|
|
global_stats.opencl_to_cpu++;
|
|
global_stats.opencl_to_cpu++;
|
|
}
|
|
}
|
|
|
|
|
|
-struct starpu_codelet cpu_to_opencl_cl = {
|
|
|
|
|
|
+struct starpu_codelet cpu_to_opencl_cl =
|
|
|
|
+{
|
|
.where = STARPU_OPENCL,
|
|
.where = STARPU_OPENCL,
|
|
.opencl_funcs = {cpu_to_opencl_func, NULL},
|
|
.opencl_funcs = {cpu_to_opencl_func, NULL},
|
|
.nbuffers = 1
|
|
.nbuffers = 1
|
|
};
|
|
};
|
|
|
|
|
|
-struct starpu_codelet opencl_to_cpu_cl = {
|
|
|
|
|
|
+struct starpu_codelet opencl_to_cpu_cl =
|
|
|
|
+{
|
|
.where = STARPU_CPU,
|
|
.where = STARPU_CPU,
|
|
.cpu_funcs = {opencl_to_cpu_func, NULL},
|
|
.cpu_funcs = {opencl_to_cpu_func, NULL},
|
|
.nbuffers = 1
|
|
.nbuffers = 1
|
|
};
|
|
};
|
|
#endif /* !STARPU_USE_OPENCL */
|
|
#endif /* !STARPU_USE_OPENCL */
|
|
|
|
|
|
-static struct starpu_multiformat_data_interface_ops ops = {
|
|
|
|
|
|
+static struct starpu_multiformat_data_interface_ops ops =
|
|
|
|
+{
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
.cuda_elemsize = sizeof(int),
|
|
.cuda_elemsize = sizeof(int),
|
|
.cpu_to_cuda_cl = &cpu_to_cuda_cl,
|
|
.cpu_to_cuda_cl = &cpu_to_cuda_cl,
|
|
@@ -142,7 +148,8 @@ static void
|
|
create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
{
|
|
{
|
|
FPRINTF(stderr, "***** Starting Task 1\n");
|
|
FPRINTF(stderr, "***** Starting Task 1\n");
|
|
- static struct starpu_codelet cl = {
|
|
|
|
|
|
+ static struct starpu_codelet cl =
|
|
|
|
+ {
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
#endif
|
|
#endif
|
|
@@ -161,7 +168,8 @@ create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
starpu_task_submit(task);
|
|
starpu_task_submit(task);
|
|
|
|
|
|
FPRINTF(stderr, "***** Starting Task 2\n");
|
|
FPRINTF(stderr, "***** Starting Task 2\n");
|
|
- static struct starpu_codelet cl2 = {
|
|
|
|
|
|
+ static struct starpu_codelet cl2 =
|
|
|
|
+ {
|
|
.where = STARPU_CPU,
|
|
.where = STARPU_CPU,
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
.nbuffers = 1
|
|
.nbuffers = 1
|
|
@@ -176,7 +184,8 @@ create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
|
|
|
|
|
|
|
|
FPRINTF(stderr, "***** Starting Task 3\n");
|
|
FPRINTF(stderr, "***** Starting Task 3\n");
|
|
- static struct starpu_codelet cl3 = {
|
|
|
|
|
|
+ static struct starpu_codelet cl3 =
|
|
|
|
+ {
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
@@ -303,7 +312,8 @@ main(void)
|
|
{
|
|
{
|
|
#ifdef STARPU_USE_CPU
|
|
#ifdef STARPU_USE_CPU
|
|
int ret;
|
|
int ret;
|
|
- struct starpu_conf conf = {
|
|
|
|
|
|
+ struct starpu_conf conf =
|
|
|
|
+ {
|
|
.ncpus = -1,
|
|
.ncpus = -1,
|
|
.ncuda = 2,
|
|
.ncuda = 2,
|
|
.nopencl = 1
|
|
.nopencl = 1
|