StarPU Handbook

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
starpu_data.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2010-2014 Université de Bordeaux 1
4 * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
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 #ifndef __STARPU_DATA_H__
19 #define __STARPU_DATA_H__
20
21 #include <starpu.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 struct _starpu_data_state;
29 typedef struct _starpu_data_state* starpu_data_handle_t;
30
31 enum starpu_data_access_mode
32 {
33 STARPU_NONE=0,
34 STARPU_R=(1<<0),
35 STARPU_W=(1<<1),
36 STARPU_RW=(STARPU_R|STARPU_W),
37 STARPU_SCRATCH=(1<<2),
38 STARPU_REDUX=(1<<3)
39 };
40
41 struct starpu_data_descr
42 {
43 starpu_data_handle_t handle;
44 enum starpu_data_access_mode mode;
45 };
46
47 struct starpu_data_interface_ops;
48
49 void starpu_data_unregister(starpu_data_handle_t handle);
50 void starpu_data_unregister_no_coherency(starpu_data_handle_t handle);
51 void starpu_data_unregister_submit(starpu_data_handle_t handle);
52 void starpu_data_invalidate(starpu_data_handle_t handle);
53 void starpu_data_invalidate_submit(starpu_data_handle_t handle);
54
55 void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important);
56
57 int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_data_access_mode mode);
58 int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode);
59 int starpu_data_acquire_cb(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
60 int starpu_data_acquire_on_node_cb(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
61 #ifdef __GCC__
62 # define STARPU_DATA_ACQUIRE_CB(handle, mode, code) do \
63 { \ \
64 void callback(void *arg) \
65 { \
66 code; \
67 starpu_data_release(handle); \
68 } \
69 starpu_data_acquire_cb(handle, mode, callback, NULL); \
70 } \
71 while(0)
72 #endif
73
74 void starpu_data_release(starpu_data_handle_t handle);
75 void starpu_data_release_on_node(starpu_data_handle_t handle, int node);
76
77 void starpu_data_display_memory_stats();
78
79 #define starpu_data_malloc_pinned_if_possible starpu_malloc
80 #define starpu_data_free_pinned_if_possible starpu_free
81
82 int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node);
83
84 int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
85
86 enum starpu_node_kind
87 {
88 STARPU_UNUSED = 0x00,
89 STARPU_CPU_RAM = 0x01,
90 STARPU_CUDA_RAM = 0x02,
91 STARPU_OPENCL_RAM = 0x03
92 };
93
94 unsigned starpu_worker_get_memory_node(unsigned workerid);
95 unsigned starpu_memory_nodes_get_count(void);
96 enum starpu_node_kind starpu_node_get_kind(unsigned node);
97
98 void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask);
99
100 void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag);
101 unsigned starpu_data_get_default_sequential_consistency_flag(void);
102 void starpu_data_set_default_sequential_consistency_flag(unsigned flag);
103
104 void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested);
105
106 struct starpu_codelet;
107
108 void starpu_data_set_reduction_methods(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl);
109
110 int starpu_data_set_rank(starpu_data_handle_t handle, int rank);
111 int starpu_data_get_rank(starpu_data_handle_t handle);
112
113 int starpu_data_set_tag(starpu_data_handle_t handle, int tag);
114 int starpu_data_get_tag(starpu_data_handle_t handle);
115
116 unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle_t handle, unsigned memory_node);
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif /* __STARPU_DATA_H__ */
starpu_node_get_kind
enum starpu_node_kind starpu_node_get_kind(unsigned node)
STARPU_CPU_RAM
Definition: starpu_data.h:89
starpu_data_set_rank
int starpu_data_set_rank(starpu_data_handle_t handle, int rank)
starpu_codelet
Definition: starpu_task.h:73
starpu_data_get_rank
int starpu_data_get_rank(starpu_data_handle_t handle)
starpu_data_advise_as_important
void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important)
starpu_node_kind
starpu_node_kind
Definition: starpu_data.h:86
starpu_data_display_memory_stats
void starpu_data_display_memory_stats()
STARPU_R
Definition: starpu_data.h:34
STARPU_UNUSED
Definition: starpu_data.h:88
starpu_data_invalidate
void starpu_data_invalidate(starpu_data_handle_t handle)
starpu_data_invalidate_submit
void starpu_data_invalidate_submit(starpu_data_handle_t handle)
starpu_data_descr::mode
enum starpu_data_access_mode mode
Definition: starpu_data.h:44
STARPU_SCRATCH
Definition: starpu_data.h:37
starpu_data_prefetch_on_node
int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
starpu_data_set_wt_mask
void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask)
starpu_data_release
void starpu_data_release(starpu_data_handle_t handle)
starpu_data_unregister_submit
void starpu_data_unregister_submit(starpu_data_handle_t handle)
STARPU_CUDA_RAM
Definition: starpu_data.h:90
starpu_data_descr::handle
starpu_data_handle_t handle
Definition: starpu_data.h:43
starpu_data_unregister
void starpu_data_unregister(starpu_data_handle_t handle)
STARPU_NONE
Definition: starpu_data.h:33
starpu_data_get_tag
int starpu_data_get_tag(starpu_data_handle_t handle)
starpu_data_set_reduction_methods
void starpu_data_set_reduction_methods(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl)
starpu_data_request_allocation
int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node)
STARPU_W
Definition: starpu_data.h:35
starpu_data_unregister_no_coherency
void starpu_data_unregister_no_coherency(starpu_data_handle_t handle)
starpu_data_acquire
int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_data_access_mode mode)
STARPU_OPENCL_RAM
Definition: starpu_data.h:91
STARPU_REDUX
Definition: starpu_data.h:38
starpu_data_interface_ops
Definition: starpu_data_interfaces.h:90
starpu_worker_get_memory_node
unsigned starpu_worker_get_memory_node(unsigned workerid)
starpu_data_set_sequential_consistency_flag
void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag)
starpu_data_acquire_cb
int starpu_data_acquire_cb(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg)
starpu_data_query_status
void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested)
starpu_data_access_mode
starpu_data_access_mode
Definition: starpu_data.h:31
starpu_data_handle_t
struct _starpu_data_state * starpu_data_handle_t
Definition: starpu_data.h:29
starpu_data_set_default_sequential_consistency_flag
void starpu_data_set_default_sequential_consistency_flag(unsigned flag)
starpu.h
starpu_data_descr
Definition: starpu_data.h:41
starpu_data_set_tag
int starpu_data_set_tag(starpu_data_handle_t handle, int tag)
STARPU_RW
Definition: starpu_data.h:36
starpu_data_get_default_sequential_consistency_flag
unsigned starpu_data_get_default_sequential_consistency_flag(void)