StarPU Internal Handbook

data_interface.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 __DATA_INTERFACE_H__
18#define __DATA_INTERFACE_H__
19
22#include <starpu.h>
23#include <common/config.h>
24#include <common/uthash.h>
25#ifdef STARPU_OPENMP
26#include <util/openmp_runtime_support.h>
27#endif
28
32 union _starpu_interface
33{
34 /* struct starpu_void_interface void; void doesn't have any data */
35 struct starpu_variable_interface variable;
36 struct starpu_vector_interface vector;
37 struct starpu_matrix_interface matrix;
38 struct starpu_block_interface block;
39 struct starpu_csr_interface csr;
40 struct starpu_bcsr_interface bcsr;
41 struct starpu_coo_interface coo;
42};
43
45 extern struct starpu_data_interface_ops starpu_interface_matrix_ops;
46 extern struct starpu_data_interface_ops starpu_interface_block_ops;
47 extern struct starpu_data_interface_ops starpu_interface_vector_ops;
48 extern struct starpu_data_interface_ops starpu_interface_csr_ops;
49 extern struct starpu_data_interface_ops starpu_interface_bcsr_ops;
50 extern struct starpu_data_interface_ops starpu_interface_variable_ops;
51 extern struct starpu_data_interface_ops starpu_interface_void_ops;
52 extern struct starpu_data_interface_ops starpu_interface_multiformat_ops;
53
54 void _starpu_data_free_interfaces(starpu_data_handle_t handle)
55 STARPU_ATTRIBUTE_INTERNAL;
56
57 extern
58 int _starpu_data_handle_init(starpu_data_handle_t handle, struct starpu_data_interface_ops *interface_ops, unsigned int mf_node);
59 void _starpu_data_initialize_per_worker(starpu_data_handle_t handle);
60
61 extern struct starpu_arbiter *_starpu_global_arbiter;
62 extern void _starpu_data_interface_init(void) STARPU_ATTRIBUTE_INTERNAL;
63 extern int __starpu_data_check_not_busy(starpu_data_handle_t handle) STARPU_ATTRIBUTE_INTERNAL STARPU_ATTRIBUTE_WARN_UNUSED_RESULT;
64#define _starpu_data_check_not_busy(handle) \
65 (STARPU_UNLIKELY(!handle->busy_count && \
66 (handle->busy_waiting || handle->lazy_unregister)) ? \
67 __starpu_data_check_not_busy(handle) : 0)
68 extern void _starpu_data_interface_shutdown(void) STARPU_ATTRIBUTE_INTERNAL;
69
70#ifdef STARPU_OPENMP
71 void _starpu_omp_unregister_region_handles(struct starpu_omp_region *region);
72 void _starpu_omp_unregister_task_handles(struct starpu_omp_task *task);
73#endif
74
75 struct starpu_data_interface_ops *_starpu_data_interface_get_ops(unsigned interface_id);
76
77 extern void _starpu_data_register_ram_pointer(starpu_data_handle_t handle,
78 void *ptr)
79 STARPU_ATTRIBUTE_INTERNAL;
80
81 extern void _starpu_data_unregister_ram_pointer(starpu_data_handle_t handle, unsigned node)
82 STARPU_ATTRIBUTE_INTERNAL;
83
84#define _starpu_data_is_multiformat_handle(handle) handle->ops->is_multiformat
85
86 void _starpu_data_invalidate_submit_noplan(starpu_data_handle_t handle);
87
88#endif // __DATA_INTERFACE_H__
starpu_interface_matrix_ops
struct starpu_data_interface_ops starpu_interface_matrix_ops
_starpu_interface
Definition: data_interface.h:33
openmp_runtime_support.h
uthash.h