StarPU Handbook
starpu_heteroprio.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2015-2017 Inria
4  * Copyright (C) 2015,2017,2019 CNRS
5  * Copyright (C) 2015-2017 Université de Bordeaux
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_SCHEDULER_HETEROPRIO_H__
20 #define __STARPU_SCHEDULER_HETEROPRIO_H__
21 
22 #include <starpu.h>
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 #define STARPU_HETEROPRIO_MAX_PRIO 100
30 /* #define STARPU_NB_TYPES 3 */
31 /* #define STARPU_CPU_IDX 0 */
32 /* #define STARPU_CUDA_IDX 1 */
33 /* #define STARPU_OPENCL_IDX 2 */
34 
35 #define STARPU_HETEROPRIO_MAX_PREFETCH 2
36 #if STARPU_HETEROPRIO_MAX_PREFETCH <= 0
37 #error STARPU_HETEROPRIO_MAX_PREFETCH == 1 means no prefetch so STARPU_HETEROPRIO_MAX_PREFETCH must >= 1
38 #endif
39 
40 enum starpu_heteroprio_types
41 {
42 // First will be zero
43  STARPU_CPU_IDX, // = 0
44  STARPU_CUDA_IDX,
45  STARPU_OPENCL_IDX,
46  STARPU_MIC_IDX,
47  STARPU_MPI_MS_IDX,
48 // This will be the number of archs
49  STARPU_NB_TYPES
50 };
51 
52 static const unsigned starpu_heteroprio_types_to_arch[STARPU_NB_TYPES+1] =
53 {
54  STARPU_CPU,
57  STARPU_MIC,
59  0
60 };
61 
63 void starpu_heteroprio_set_nb_prios(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned max_prio);
64 
66 void starpu_heteroprio_set_mapping(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned source_prio, unsigned dest_bucket_id);
67 
69 void starpu_heteroprio_set_faster_arch(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id);
70 
72 void starpu_heteroprio_set_arch_slow_factor(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id, float slow_factor);
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* __STARPU_SCHEDULER_HETEROPRIO_H__ */
#define STARPU_CUDA
Definition: starpu_task.h:64
#define STARPU_CPU
Definition: starpu_task.h:57
#define STARPU_OPENCL
Definition: starpu_task.h:71
#define STARPU_MIC
Definition: starpu_task.h:78
void starpu_heteroprio_set_nb_prios(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned max_prio)
void starpu_heteroprio_set_mapping(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned source_prio, unsigned dest_bucket_id)
#define STARPU_MPI_MS
Definition: starpu_task.h:85
void starpu_heteroprio_set_arch_slow_factor(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id, float slow_factor)
void starpu_heteroprio_set_faster_arch(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id)