StarPU Handbook
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
include
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
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
Generated on Wed Sep 2 2015 11:14:23 for StarPU Handbook by
1.8.1.2