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-2020 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;
49 
50 #ifdef STARPU_USE_MIC
51 
55 {
56  unsigned memory_node;
57  int mark;
58  uint64_t *signal;
59 };
60 #endif
61 
62 #ifdef STARPU_USE_MPI_MASTER_SLAVE
63 LIST_TYPE(_starpu_mpi_ms_event_request,
64  MPI_Request request;
65 );
66 
67 struct _starpu_mpi_ms_async_event
68 {
69  int is_sender;
70  struct _starpu_mpi_ms_event_request_list * requests;
71 };
72 #endif
73 
75  void *backend_event;
76 );
77 
79 {
80  unsigned memory_node;
81  struct _starpu_disk_backend_event_list * requests;
82 
83  void * ptr;
84  unsigned node;
85  size_t size;
86  starpu_data_handle_t handle;
87 };
88 
92 {
93 #ifdef STARPU_SIMGRID
94  struct
95  {
96  unsigned finished;
97  starpu_pthread_queue_t *queue;
98  };
99 #endif
100 #ifdef STARPU_USE_CUDA
101  cudaEvent_t cuda_event;
102 #endif
103 #ifdef STARPU_USE_OPENCL
104  cl_event opencl_event;
105 #endif
106 #ifdef STARPU_USE_MPI_MASTER_SLAVE
107  struct _starpu_mpi_ms_async_event mpi_ms_event;
108 #endif
109 #ifdef STARPU_USE_MIC
110  struct _starpu_mic_async_event mic_event;
111 #endif
112  struct _starpu_disk_async_event disk_event;
113 };
114 
116 {
117  union _starpu_async_channel_event event;
118  struct _starpu_node_ops *node_ops;
120  struct _starpu_mp_node *polling_node_sender;
121  struct _starpu_mp_node *polling_node_receiver;
124  volatile int starpu_mp_common_finished_receiver;
125 };
126 
127 void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid);
128 
129 int _starpu_driver_copy_data_1_to_1(starpu_data_handle_t handle,
130  struct _starpu_data_replicate *src_replicate,
131  struct _starpu_data_replicate *dst_replicate,
132  unsigned donotread,
133  struct _starpu_data_request *req,
134  unsigned may_alloc,
135  unsigned prefetch);
136 
137 unsigned _starpu_driver_test_request_completion(struct _starpu_async_channel *async_channel);
138 void _starpu_driver_wait_request_completion(struct _starpu_async_channel *async_channel);
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif // __COPY_DRIVER_H__
_starpu_async_channel_event
Definition: copy_driver.h:92
_starpu_data_replicate
Definition: coherency.h:45
_starpu_disk_async_event
Definition: copy_driver.h:79
_starpu_mic_async_event
Definition: copy_driver.h:55
_starpu_async_channel::starpu_mp_common_finished_sender
volatile int starpu_mp_common_finished_sender
Definition: copy_driver.h:123
_starpu_disk_backend_event
Definition: copy_driver.h:74
_starpu_async_channel::polling_node_sender
struct _starpu_mp_node * polling_node_sender
Definition: copy_driver.h:120
_starpu_async_channel
Definition: copy_driver.h:116
_starpu_node_ops
Definition: node_ops.h:48