/* StarPU --- Runtime system for heterogeneous multicore architectures. * * Copyright (C) 2018 CNRS * Copyright (C) 2018 Université de Bordeaux * * StarPU is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * StarPU is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU Lesser General Public License in COPYING.LGPL for more details. */ #include #define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0) #define NX 9 #define PARTS 3 struct starpu_codelet task_codelet; // CPU implementations void task_cpu(void *descr[], void *args) { int *values = (int*)STARPU_VECTOR_GET_PTR(descr[0]); int nx = STARPU_VECTOR_GET_NX(descr[0]); int i, add; char message[10000]; int cur = 0; starpu_codelet_unpack_args(args, &add); cur += snprintf(&message[cur], 10000-cur, "Values "); for(i=0 ; i= 0 ; i--) values[i] = values[i+1] * 2; for(i=0 ; i