StarPU Internal Handbook

node_ops.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 __NODE_OPS_H__
18#define __NODE_OPS_H__
19
22#include <starpu.h>
23#include <common/config.h>
24#include <datawizard/copy_driver.h>
25
26 typedef int (*copy_interface_func_t)(starpu_data_handle_t handle, void *src_interface, unsigned src_node,
27 void *dst_interface, unsigned dst_node,
28 struct _starpu_data_request *req);
29
30 typedef int (*copy_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
31 uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
32 size_t ssize, struct _starpu_async_channel *async_channel);
33
34 typedef int (*copy2d_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
35 uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
36 size_t blocksize,
37 size_t numblocks, size_t ld_src, size_t ld_dst,
38 struct _starpu_async_channel *async_channel);
39
40 typedef int (*copy3d_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
41 uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
42 size_t blocksize,
43 size_t numblocks_1, size_t ld1_src, size_t ld1_dst,
44 size_t numblocks_2, size_t ld2_src, size_t ld2_dst,
45 struct _starpu_async_channel *async_channel);
46
47 struct _starpu_node_ops
48{
49 copy_interface_func_t copy_interface_to[STARPU_MPI_MS_RAM+1];
50 copy_data_t copy_data_to[STARPU_MPI_MS_RAM+1];
51 copy2d_data_t copy2d_data_to[STARPU_MPI_MS_RAM+1];
52 copy3d_data_t copy3d_data_to[STARPU_MPI_MS_RAM+1];
53 void (*wait_request_completion)(struct _starpu_async_channel *async_channel);
54 unsigned (*test_request_completion)(struct _starpu_async_channel *async_channel);
55 int (*is_direct_access_supported)(unsigned node, unsigned handling_node);
56 uintptr_t (*malloc_on_node)(unsigned dst_node, size_t size, int flags);
57 void (*free_on_node)(unsigned dst_node, uintptr_t addr, size_t size, int flags);
58 char *name;
59};
60
61 const char* _starpu_node_get_prefix(enum starpu_node_kind kind);
62
63#endif // __NODE_OPS_H__
copy_driver.h
_starpu_async_channel
Definition: copy_driver.h:127
_starpu_node_ops
Definition: node_ops.h:48