StarPU Internal Handbook

fifo_queues.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2008-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 * Copyright (C) 2016 Uppsala University
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/* FIFO queues, ready for use by schedulers */
19
20#ifndef __FIFO_QUEUES_H__
21#define __FIFO_QUEUES_H__
22
25#include <starpu.h>
26#include <core/task.h>
27
28 struct _starpu_fifo_taskq
29{
31 struct starpu_task_list taskq;
32
34 unsigned ntasks;
35
37 unsigned *ntasks_per_priority;
38
40 unsigned nprocessed;
41
43 double exp_start;
46 double exp_end;
47 double exp_len;
48 double *exp_len_per_priority;
49 double pipeline_len;
50};
51
52 struct _starpu_fifo_taskq*_starpu_create_fifo(void) STARPU_ATTRIBUTE_MALLOC;
53 void _starpu_destroy_fifo(struct _starpu_fifo_taskq *fifo);
54
55 int _starpu_fifo_empty(struct _starpu_fifo_taskq *fifo);
56
57 double _starpu_fifo_get_exp_len_prev_task_list(struct _starpu_fifo_taskq *fifo_queue, struct starpu_task *task,
58 int workerid, int nimpl, int *fifo_ntasks);
59
60 int _starpu_fifo_push_sorted_task(struct _starpu_fifo_taskq *fifo_queue, struct starpu_task *task);
61
62 int _starpu_fifo_push_task(struct _starpu_fifo_taskq *fifo, struct starpu_task *task);
63 int _starpu_fifo_push_back_task(struct _starpu_fifo_taskq *fifo_queue, struct starpu_task *task);
64
65 int _starpu_fifo_pop_this_task(struct _starpu_fifo_taskq *fifo_queue, int workerid, struct starpu_task *task);
66 struct starpu_task *_starpu_fifo_pop_task(struct _starpu_fifo_taskq *fifo, int workerid);
67 struct starpu_task *_starpu_fifo_pop_local_task(struct _starpu_fifo_taskq *fifo);
68 struct starpu_task *_starpu_fifo_pop_every_task(struct _starpu_fifo_taskq *fifo, int workerid);
69 int _starpu_normalize_prio(int priority, int num_priorities, unsigned sched_ctx_id);
70 int _starpu_count_non_ready_buffers(struct starpu_task *task, unsigned worker);
71 size_t _starpu_size_non_ready_buffers(struct starpu_task *task, unsigned worker);
72 struct starpu_task *_starpu_fifo_pop_first_ready_task(struct _starpu_fifo_taskq *fifo_queue, unsigned workerid, int num_priorities);
73
74#endif // __FIFO_QUEUES_H__
_starpu_fifo_taskq::exp_len
double exp_len
Definition: fifo_queues.h:47
_starpu_fifo_taskq::ntasks_per_priority
unsigned * ntasks_per_priority
Definition: fifo_queues.h:37
_starpu_fifo_taskq::exp_start
double exp_start
Definition: fifo_queues.h:43
_starpu_fifo_taskq::nprocessed
unsigned nprocessed
Definition: fifo_queues.h:40
_starpu_fifo_taskq::exp_len_per_priority
double * exp_len_per_priority
Definition: fifo_queues.h:48
_starpu_fifo_taskq::exp_end
double exp_end
Definition: fifo_queues.h:46
_starpu_fifo_taskq::ntasks
unsigned ntasks
Definition: fifo_queues.h:34
_starpu_fifo_taskq::pipeline_len
double pipeline_len
Definition: fifo_queues.h:49
_starpu_fifo_taskq::taskq
struct starpu_task_list taskq
Definition: fifo_queues.h:31
_starpu_fifo_taskq
Definition: fifo_queues.h:29
task.h