StarPU Handbook

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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 1
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
29 enum starpu_worker_archtype
30 {
31 STARPU_ANY_WORKER,
32 STARPU_CPU_WORKER,
33 STARPU_CUDA_WORKER,
34 STARPU_OPENCL_WORKER
35 };
36
37 struct starpu_sched_ctx_iterator
38 {
39 int cursor;
40 };
41
42 enum starpu_worker_collection_type
43 {
44 STARPU_WORKER_LIST
45 };
46
47 struct starpu_worker_collection
48 {
49 void *workerids;
50 unsigned nworkers;
51 enum starpu_worker_collection_type type;
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);
58 void (*init_iterator)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
59 };
60
61 unsigned starpu_worker_get_count(void);
62 unsigned starpu_combined_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
71 int starpu_combined_worker_get_id(void);
72 int starpu_combined_worker_get_size(void);
73 int starpu_combined_worker_get_rank(void);
74
75 enum starpu_worker_archtype starpu_worker_get_type(int id);
76
77 int starpu_worker_get_count_by_type(enum starpu_worker_archtype type);
78
79 int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
80
81 int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num);
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
starpu_worker_collection::init
void(* init)(struct starpu_worker_collection *workers)
Definition: starpu_worker.h:56
starpu_worker_get_ids_by_type
int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
starpu_sched_ctx_iterator::cursor
int cursor
Definition: starpu_worker.h:39
starpu_worker_collection
Definition: starpu_worker.h:47
starpu_combined_worker_get_size
int starpu_combined_worker_get_size(void)
STARPU_OPENCL_WORKER
Definition: starpu_worker.h:34
starpu_worker_collection::init_iterator
void(* init_iterator)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
Definition: starpu_worker.h:58
starpu_combined_worker_get_id
int starpu_combined_worker_get_id(void)
starpu_worker_collection::add
int(* add)(struct starpu_worker_collection *workers, int worker)
Definition: starpu_worker.h:54
starpu_combined_worker_get_rank
int starpu_combined_worker_get_rank(void)
starpu_worker_archtype
starpu_worker_archtype
Definition: starpu_worker.h:29
STARPU_CUDA_WORKER
Definition: starpu_worker.h:33
starpu_worker_collection::deinit
void(* deinit)(struct starpu_worker_collection *workers)
Definition: starpu_worker.h:57
starpu_worker_get_by_type
int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num)
starpu_sched_ctx_iterator
Definition: starpu_worker.h:37
STARPU_CPU_WORKER
Definition: starpu_worker.h:32
starpu_worker_collection::workerids
void * workerids
Definition: starpu_worker.h:49
starpu_combined_worker_get_count
unsigned starpu_combined_worker_get_count(void)
starpu_worker_collection::type
enum starpu_worker_collection_type type
Definition: starpu_worker.h:51
STARPU_WORKER_LIST
Definition: starpu_worker.h:44
starpu_worker_collection::has_next
unsigned(* has_next)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
Definition: starpu_worker.h:52
starpu_worker_get_by_devid
int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid)
starpu_cpu_worker_get_count
unsigned starpu_cpu_worker_get_count(void)
starpu_worker_collection::nworkers
unsigned nworkers
Definition: starpu_worker.h:50
starpu_worker_get_type
enum starpu_worker_archtype starpu_worker_get_type(int id)
STARPU_ANY_WORKER
Definition: starpu_worker.h:31
starpu_worker_get_name
void starpu_worker_get_name(int id, char *dst, size_t maxlen)
starpu_opencl_worker_get_count
unsigned starpu_opencl_worker_get_count(void)
starpu_config.h
starpu_worker_get_id
int starpu_worker_get_id(void)
starpu_worker_get_count
unsigned starpu_worker_get_count(void)
starpu_worker_collection::get_next
int(* get_next)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
Definition: starpu_worker.h:53
starpu_worker_collection_type
starpu_worker_collection_type
Definition: starpu_worker.h:42
starpu_cuda_worker_get_count
unsigned starpu_cuda_worker_get_count(void)
starpu_worker_get_devid
int starpu_worker_get_devid(int id)
starpu_worker_get_count_by_type
int starpu_worker_get_count_by_type(enum starpu_worker_archtype type)