StarPU Handbook
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
starpu_task_util.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2010-2013, 2015 Université de Bordeaux
4  * Copyright (C) 2010-2013 Centre National de la Recherche Scientifique
5  * Copyright (C) 2014 INRIA
6  *
7  * StarPU is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation; either version 2.1 of the License, or (at
10  * your option) any later version.
11  *
12  * StarPU is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
17  */
18 
19 #ifndef __STARPU_TASK_UTIL_H__
20 #define __STARPU_TASK_UTIL_H__
21 
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <assert.h>
26 #include <starpu.h>
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 void starpu_create_sync_task(starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t *deps, void (*callback)(void *), void *callback_arg);
34 
35 #define STARPU_MODE_SHIFT 16
36 #define STARPU_VALUE (1<<STARPU_MODE_SHIFT)
37 #define STARPU_CALLBACK (2<<STARPU_MODE_SHIFT)
38 #define STARPU_CALLBACK_WITH_ARG (3<<STARPU_MODE_SHIFT)
39 #define STARPU_CALLBACK_ARG (4<<STARPU_MODE_SHIFT)
40 #define STARPU_PRIORITY (5<<STARPU_MODE_SHIFT)
41 #define STARPU_EXECUTE_ON_NODE (6<<STARPU_MODE_SHIFT)
42 #define STARPU_EXECUTE_ON_DATA (7<<STARPU_MODE_SHIFT)
43 #define STARPU_DATA_ARRAY (8<<STARPU_MODE_SHIFT)
44 #define STARPU_TAG (9<<STARPU_MODE_SHIFT)
45 #define STARPU_HYPERVISOR_TAG (10<<STARPU_MODE_SHIFT)
46 #define STARPU_FLOPS (11<<STARPU_MODE_SHIFT)
47 #define STARPU_SCHED_CTX (12<<STARPU_MODE_SHIFT)
48 #define STARPU_PROLOGUE_CALLBACK (13<<STARPU_MODE_SHIFT)
49 #define STARPU_PROLOGUE_CALLBACK_ARG (14<<STARPU_MODE_SHIFT)
50 #define STARPU_EXECUTE_ON_WORKER (15<<STARPU_MODE_SHIFT)
51 #define STARPU_SHIFTED_MODE_MAX (16<<STARPU_MODE_SHIFT)
52 
53 struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...);
54 int starpu_insert_task(struct starpu_codelet *cl, ...);
55 
56 void starpu_codelet_unpack_args(void *cl_arg, ...);
57 
58 void starpu_codelet_pack_args(void **arg_buffer, size_t *arg_buffer_size, ...);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* __STARPU_TASK_UTIL_H__ */