StarPU Internal Handbook

copy_driver.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 *
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 __COPY_DRIVER_H__
18#define __COPY_DRIVER_H__
19
22#ifdef HAVE_AIO_H
23#include <aio.h>
24#endif
25
26#include <common/config.h>
27#include <common/list.h>
28
29#ifdef STARPU_USE_CUDA
30#include <cuda.h>
31#include <cuda_runtime.h>
32#endif
33
34#ifdef STARPU_USE_OPENCL
35#include <starpu_opencl.h>
36#endif
37
38#ifdef STARPU_USE_MPI_MASTER_SLAVE
39#include <mpi.h>
40#endif
41
42#ifdef __cplusplus
43 extern "C"
44{
45#endif
46
47 struct _starpu_data_request;
48 struct _starpu_data_replicate;
49
50 enum _starpu_is_prefetch
51{
53 STARPU_FETCH = 0,
55 STARPU_PREFETCH = 1,
57 STARPU_IDLEFETCH = 2,
58 STARPU_NFETCH
59};
60
61#ifdef STARPU_USE_MIC
65 struct _starpu_mic_async_event
66{
67 unsigned memory_node;
68 int mark;
69 uint64_t *signal;
70};
71#endif
72
73#ifdef STARPU_USE_MPI_MASTER_SLAVE
74LIST_TYPE(_starpu_mpi_ms_event_request,
75 MPI_Request request;
76);
77
78 struct _starpu_mpi_ms_async_event
79{
80 int is_sender;
81 struct _starpu_mpi_ms_event_request_list * requests;
82};
83#endif
84
85LIST_TYPE(_starpu_disk_backend_event,
86 void *backend_event;
87);
88
89 struct _starpu_disk_async_event
90{
91 unsigned memory_node;
92 struct _starpu_disk_backend_event_list * requests;
93
94 void * ptr;
95 unsigned node;
96 size_t size;
97 starpu_data_handle_t handle;
98};
99
102 union _starpu_async_channel_event
103{
104#ifdef STARPU_SIMGRID
105 struct
106 {
107 unsigned finished;
108 starpu_pthread_queue_t *queue;
109 };
110#endif
111#ifdef STARPU_USE_CUDA
112 cudaEvent_t cuda_event;
113#endif
114#ifdef STARPU_USE_OPENCL
115 cl_event opencl_event;
116#endif
117#ifdef STARPU_USE_MPI_MASTER_SLAVE
118 struct _starpu_mpi_ms_async_event mpi_ms_event;
119#endif
120#ifdef STARPU_USE_MIC
121 struct _starpu_mic_async_event mic_event;
122#endif
123 struct _starpu_disk_async_event disk_event;
124};
125
126 struct _starpu_async_channel
127{
128 union _starpu_async_channel_event event;
129 struct _starpu_node_ops *node_ops;
131 struct _starpu_mp_node *polling_node_sender;
132 struct _starpu_mp_node *polling_node_receiver;
134 volatile int starpu_mp_common_finished_sender;
135 volatile int starpu_mp_common_finished_receiver;
136};
137
138 void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid);
139
140 int _starpu_driver_copy_data_1_to_1(starpu_data_handle_t handle,
141 struct _starpu_data_replicate *src_replicate,
142 struct _starpu_data_replicate *dst_replicate,
143 unsigned donotread,
144 struct _starpu_data_request *req,
145 unsigned may_alloc,
146 enum _starpu_is_prefetch prefetch);
147
148 unsigned _starpu_driver_test_request_completion(struct _starpu_async_channel *async_channel);
149 void _starpu_driver_wait_request_completion(struct _starpu_async_channel *async_channel);
150
151#ifdef __cplusplus
152}
153#endif
154
155#endif // __COPY_DRIVER_H__
_starpu_data_replicate
Definition: coherency.h:45
_starpu_async_channel::starpu_mp_common_finished_sender
volatile int starpu_mp_common_finished_sender
Definition: copy_driver.h:134
_starpu_is_prefetch
_starpu_is_prefetch
Definition: copy_driver.h:51
STARPU_PREFETCH
@ STARPU_PREFETCH
Definition: copy_driver.h:55
STARPU_IDLEFETCH
@ STARPU_IDLEFETCH
Definition: copy_driver.h:57
STARPU_FETCH
@ STARPU_FETCH
Definition: copy_driver.h:53
_starpu_async_channel::polling_node_sender
struct _starpu_mp_node * polling_node_sender
Definition: copy_driver.h:131
_starpu_async_channel
Definition: copy_driver.h:127
_starpu_disk_async_event
Definition: copy_driver.h:90
_starpu_disk_backend_event
Definition: copy_driver.h:85
_starpu_mic_async_event
Definition: copy_driver.h:66
_starpu_async_channel_event
Definition: copy_driver.h:103
list.h
_starpu_node_ops
Definition: node_ops.h:48