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-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  *
5  * StarPU is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; either version 2.1 of the License, or (at
8  * your option) any later version.
9  *
10  * StarPU is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15  */
16 
17 #ifndef __STARPU_SCHEDULER_HETEROPRIO_H__
18 #define __STARPU_SCHEDULER_HETEROPRIO_H__
19 
20 #include <starpu.h>
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 #define STARPU_HETEROPRIO_MAX_PRIO 100
28 /* #define STARPU_NB_TYPES 3 */
29 /* #define STARPU_CPU_IDX 0 */
30 /* #define STARPU_CUDA_IDX 1 */
31 /* #define STARPU_OPENCL_IDX 2 */
32 
33 #define STARPU_HETEROPRIO_MAX_PREFETCH 2
34 #if STARPU_HETEROPRIO_MAX_PREFETCH <= 0
35 #error STARPU_HETEROPRIO_MAX_PREFETCH == 1 means no prefetch so STARPU_HETEROPRIO_MAX_PREFETCH must >= 1
36 #endif
37 
38 enum starpu_heteroprio_types
39 {
40 // First will be zero
41  STARPU_CPU_IDX, // = 0
42  STARPU_CUDA_IDX,
43  STARPU_OPENCL_IDX,
44  STARPU_MIC_IDX,
45  STARPU_MPI_MS_IDX,
46 // This will be the number of archs
47  STARPU_NB_TYPES
48 };
49 
50 static const unsigned starpu_heteroprio_types_to_arch[STARPU_NB_TYPES+1] =
51 {
52  STARPU_CPU,
55  STARPU_MIC,
57  0
58 };
59 
61 void starpu_heteroprio_set_nb_prios(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned max_prio);
62 
64 void starpu_heteroprio_set_mapping(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned source_prio, unsigned dest_bucket_id);
65 
67 void starpu_heteroprio_set_faster_arch(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id);
68 
70 void starpu_heteroprio_set_arch_slow_factor(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id, float slow_factor);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* __STARPU_SCHEDULER_HETEROPRIO_H__ */
#define STARPU_MPI_MS
Definition: starpu_task.h:83
#define STARPU_CUDA
Definition: starpu_task.h:62
#define STARPU_MIC
Definition: starpu_task.h:76
#define STARPU_OPENCL
Definition: starpu_task.h:69
#define STARPU_CPU
Definition: starpu_task.h:55
void starpu_heteroprio_set_mapping(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned source_prio, unsigned dest_bucket_id)
void starpu_heteroprio_set_faster_arch(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id)
void starpu_heteroprio_set_nb_prios(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned max_prio)
void starpu_heteroprio_set_arch_slow_factor(unsigned sched_ctx_id, enum starpu_heteroprio_types arch, unsigned bucket_id, float slow_factor)