StarPU Handbook
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
starpu_worker.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2009-2013 Université de Bordeaux
4  * Copyright (C) 2010-2013 Centre National de la Recherche Scientifique
5  *
6  * StarPU is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at
9  * your option) any later version.
10  *
11  * StarPU is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  *
15  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16  */
17 
18 #ifndef __STARPU_WORKER_H__
19 #define __STARPU_WORKER_H__
20 
21 #include <stdlib.h>
22 #include <starpu_config.h>
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
30 {
35 };
36 
38 {
39  int cursor;
40 };
41 
43 {
45 };
46 
48 {
49  void *workerids;
50  unsigned nworkers;
52  unsigned (*has_next)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
53  int (*get_next)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
54  int (*add)(struct starpu_worker_collection *workers, int worker);
55  int (*remove)(struct starpu_worker_collection *workers, int worker);
56  void (*init)(struct starpu_worker_collection *workers);
57  void (*deinit)(struct starpu_worker_collection *workers);
59 };
60 
61 unsigned starpu_worker_get_count(void);
63 unsigned starpu_worker_is_combined_worker(int id);
64 
65 unsigned starpu_cpu_worker_get_count(void);
66 unsigned starpu_cuda_worker_get_count(void);
67 unsigned starpu_opencl_worker_get_count(void);
68 
69 int starpu_worker_get_id(void);
70 
74 
76 
78 
79 int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
80 
82 
83 int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid);
84 
85 void starpu_worker_get_name(int id, char *dst, size_t maxlen);
86 
87 int starpu_worker_get_devid(int id);
88 
89 int starpu_worker_get_nsched_ctxs(int workerid);
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* __STARPU_WORKER_H__ */
96