Loading...
Searching...
No Matches
starpu_data.h
Go to the documentation of this file.
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2009-2024 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
* Copyright (C) 2021 Federal University of Rio Grande do Sul (UFRGS)
*
* StarPU is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* StarPU is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU Lesser General Public License in COPYING.LGPL for more details.
*/
#ifndef __STARPU_DATA_H__
#define __STARPU_DATA_H__
#include <starpu.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _starpu_data_state;
typedef struct _starpu_data_state *starpu_data_handle_t;
enum starpu_data_access_mode
{
STARPU_NONE = 0,
STARPU_R = (1 << 0),
STARPU_W = (1 << 1),
STARPU_RW = (STARPU_R | STARPU_W),
STARPU_SCRATCH = (1 << 2),
STARPU_REDUX = (1 << 3),
STARPU_COMMUTE = (1 << 4),
STARPU_SSEND = (1 << 5),
STARPU_LOCALITY = (1 << 6),
STARPU_MPI_REDUX = (1 << 7),
STARPU_NOPLAN = (1 << 8),
STARPU_UNMAP = (1 << 9),
STARPU_NOFOOTPRINT = (1 << 10),
STARPU_ACCESS_MODE_MAX = (1 << 11)
};
struct starpu_data_interface_ops;
void starpu_data_set_name(starpu_data_handle_t handle, const char *name);
void starpu_data_set_coordinates_array(starpu_data_handle_t handle, unsigned dimensions, int dims[]);
void starpu_data_set_coordinates(starpu_data_handle_t handle, unsigned dimensions, ...);
unsigned starpu_data_get_coordinates_array(starpu_data_handle_t handle, unsigned dimensions, int dims[]);
void starpu_data_unregister(starpu_data_handle_t handle);
void starpu_data_unregister_no_coherency(starpu_data_handle_t handle);
void starpu_data_unregister_submit(starpu_data_handle_t handle);
void starpu_data_deinitialize(starpu_data_handle_t handle);
void starpu_data_deinitialize_submit(starpu_data_handle_t handle);
void starpu_data_invalidate(starpu_data_handle_t handle);
void starpu_data_invalidate_submit(starpu_data_handle_t handle);
void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important);
#define STARPU_ACQUIRE_NO_NODE -1
#define STARPU_ACQUIRE_NO_NODE_LOCK_ALL -2
int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_data_access_mode mode);
int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode);
int starpu_data_acquire_cb(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
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);
int starpu_data_acquire_cb_sequential_consistency(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg, int sequential_consistency);
int starpu_data_acquire_on_node_cb_sequential_consistency(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg, int sequential_consistency);
int starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (*callback_acquired)(void *arg, int *node, enum starpu_data_access_mode mode), void (*callback)(void *arg), void *arg, int sequential_consistency, int quick, long *pre_sync_jobid, long *post_sync_jobid, int prio);
int starpu_data_acquire_try(starpu_data_handle_t handle, enum starpu_data_access_mode mode);
int starpu_data_acquire_on_node_try(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode);
#ifdef __GCC__
#define STARPU_DATA_ACQUIRE_CB(handle, mode, code) \
do \
{ \
void callback(void *arg) \
{ \
code; \
starpu_data_release(handle); \
} \
starpu_data_acquire_cb(handle, mode, callback, NULL); \
} \
while (0)
#endif
void starpu_data_release(starpu_data_handle_t handle);
void starpu_data_release_on_node(starpu_data_handle_t handle, int node);
void starpu_data_release_to(starpu_data_handle_t handle, enum starpu_data_access_mode down_to_mode);
void starpu_data_release_to_on_node(starpu_data_handle_t handle, enum starpu_data_access_mode down_to_mode, int node);
typedef struct starpu_arbiter *starpu_arbiter_t;
starpu_arbiter_t starpu_arbiter_create(void) STARPU_ATTRIBUTE_MALLOC;
void starpu_data_assign_arbiter(starpu_data_handle_t handle, starpu_arbiter_t arbiter);
void starpu_arbiter_destroy(starpu_arbiter_t arbiter);
int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node);
enum starpu_is_prefetch
{
STARPU_FETCH = 0,
STARPU_TASK_PREFETCH = 1,
STARPU_PREFETCH = 2,
STARPU_IDLEFETCH = 3,
STARPU_NFETCH
};
int starpu_data_fetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
int starpu_data_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
int starpu_data_idle_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
unsigned starpu_data_is_on_node(starpu_data_handle_t handle, unsigned node);
void starpu_data_wont_use(starpu_data_handle_t handle);
int starpu_data_evict_from_node(starpu_data_handle_t handle, unsigned node);
void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask);
void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag);
unsigned starpu_data_get_sequential_consistency_flag(starpu_data_handle_t handle);
unsigned starpu_data_get_default_sequential_consistency_flag(void);
void starpu_data_set_default_sequential_consistency_flag(unsigned flag);
void starpu_data_set_ooc_flag(starpu_data_handle_t handle, unsigned flag);
unsigned starpu_data_get_ooc_flag(starpu_data_handle_t handle);
void starpu_data_query_status2(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_loading, int *is_requested);
void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested);
struct starpu_codelet;
void starpu_data_set_reduction_methods(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl);
void starpu_data_set_reduction_methods_with_args(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, void *redux_cl_arg, struct starpu_codelet *init_cl, void *init_cl_arg);
struct starpu_data_interface_ops *starpu_data_get_interface_ops(starpu_data_handle_t handle);
unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle_t handle, unsigned memory_node);
unsigned starpu_data_test_if_mapped_on_node(starpu_data_handle_t handle, unsigned memory_node);
void starpu_memchunk_tidy(unsigned memory_node);
void starpu_data_set_user_data(starpu_data_handle_t handle, void *user_data);
void *starpu_data_get_user_data(starpu_data_handle_t handle);
void starpu_data_set_sched_data(starpu_data_handle_t handle, void *sched_data);
void *starpu_data_get_sched_data(starpu_data_handle_t handle);
int starpu_data_can_evict(starpu_data_handle_t handle, unsigned node, enum starpu_is_prefetch is_prefetch);
#ifdef __cplusplus
}
#endif
#endif /* __STARPU_DATA_H__ */
starpu_codelet
Definition starpu_task.h:338
starpu_data_interface_ops::name
char * name
Definition starpu_data_interfaces.h:686
starpu_data_interface_ops
Definition starpu_data_interfaces.h:372
starpu_data_set_user_data
void starpu_data_set_user_data(starpu_data_handle_t handle, void *user_data)
starpu_data_invalidate_submit
void starpu_data_invalidate_submit(starpu_data_handle_t handle)
starpu_data_deinitialize
void starpu_data_deinitialize(starpu_data_handle_t handle)
starpu_data_set_default_sequential_consistency_flag
void starpu_data_set_default_sequential_consistency_flag(unsigned flag)
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_access_mode
starpu_data_access_mode
Definition starpu_data.h:56
starpu_data_deinitialize_submit
void starpu_data_deinitialize_submit(starpu_data_handle_t handle)
starpu_data_set_sequential_consistency_flag
void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag)
starpu_data_test_if_allocated_on_node
unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle_t handle, unsigned memory_node)
starpu_arbiter_destroy
void starpu_arbiter_destroy(starpu_arbiter_t arbiter)
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_acquire_on_node
int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode)
starpu_data_invalidate
void starpu_data_invalidate(starpu_data_handle_t handle)
starpu_data_unregister_submit
void starpu_data_unregister_submit(starpu_data_handle_t handle)
starpu_data_idle_prefetch_on_node_prio
int starpu_data_idle_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio)
starpu_data_prefetch_on_node
int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
starpu_data_unregister
void starpu_data_unregister(starpu_data_handle_t handle)
starpu_data_release_on_node
void starpu_data_release_on_node(starpu_data_handle_t handle, int node)
starpu_data_set_sched_data
void starpu_data_set_sched_data(starpu_data_handle_t handle, void *sched_data)
starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids
int starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void(*callback_acquired)(void *arg, int *node, enum starpu_data_access_mode mode), void(*callback)(void *arg), void *arg, int sequential_consistency, int quick, long *pre_sync_jobid, long *post_sync_jobid, int prio)
starpu_data_query_status2
void starpu_data_query_status2(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_loading, int *is_requested)
starpu_data_acquire_cb_sequential_consistency
int starpu_data_acquire_cb_sequential_consistency(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg, int sequential_consistency)
starpu_data_acquire_on_node_try
int starpu_data_acquire_on_node_try(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode)
starpu_data_release_to
void starpu_data_release_to(starpu_data_handle_t handle, enum starpu_data_access_mode down_to_mode)
starpu_is_prefetch
starpu_is_prefetch
Definition starpu_data.h:486
starpu_data_get_ooc_flag
unsigned starpu_data_get_ooc_flag(starpu_data_handle_t handle)
starpu_arbiter_create
starpu_arbiter_t starpu_arbiter_create(void) STARPU_ATTRIBUTE_MALLOC
starpu_data_get_coordinates_array
unsigned starpu_data_get_coordinates_array(starpu_data_handle_t handle, unsigned dimensions, int dims[])
starpu_data_set_ooc_flag
void starpu_data_set_ooc_flag(starpu_data_handle_t handle, unsigned flag)
starpu_data_is_on_node
unsigned starpu_data_is_on_node(starpu_data_handle_t handle, unsigned node)
starpu_data_acquire_on_node_cb
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)
starpu_data_release_to_on_node
void starpu_data_release_to_on_node(starpu_data_handle_t handle, enum starpu_data_access_mode down_to_mode, int node)
starpu_data_acquire_try
int starpu_data_acquire_try(starpu_data_handle_t handle, enum starpu_data_access_mode mode)
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_assign_arbiter
void starpu_data_assign_arbiter(starpu_data_handle_t handle, starpu_arbiter_t arbiter)
starpu_data_fetch_on_node
int starpu_data_fetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
starpu_data_set_coordinates_array
void starpu_data_set_coordinates_array(starpu_data_handle_t handle, unsigned dimensions, int dims[])
starpu_data_unregister_no_coherency
void starpu_data_unregister_no_coherency(starpu_data_handle_t handle)
starpu_data_get_sched_data
void * starpu_data_get_sched_data(starpu_data_handle_t handle)
starpu_data_set_name
void starpu_data_set_name(starpu_data_handle_t handle, const char *name)
starpu_data_get_user_data
void * starpu_data_get_user_data(starpu_data_handle_t handle)
starpu_data_evict_from_node
int starpu_data_evict_from_node(starpu_data_handle_t handle, unsigned node)
starpu_data_set_coordinates
void starpu_data_set_coordinates(starpu_data_handle_t handle, unsigned dimensions,...)
starpu_data_set_reduction_methods_with_args
void starpu_data_set_reduction_methods_with_args(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, void *redux_cl_arg, struct starpu_codelet *init_cl, void *init_cl_arg)
starpu_arbiter_t
struct starpu_arbiter * starpu_arbiter_t
Definition starpu_data.h:451
starpu_data_request_allocation
int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node)
starpu_data_test_if_mapped_on_node
unsigned starpu_data_test_if_mapped_on_node(starpu_data_handle_t handle, unsigned memory_node)
starpu_data_get_sequential_consistency_flag
unsigned starpu_data_get_sequential_consistency_flag(starpu_data_handle_t handle)
starpu_data_idle_prefetch_on_node
int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
starpu_data_handle_t
struct _starpu_data_state * starpu_data_handle_t
Definition starpu_data.h:45
starpu_data_release
void starpu_data_release(starpu_data_handle_t handle)
starpu_data_set_wt_mask
void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask)
starpu_data_prefetch_on_node_prio
int starpu_data_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio)
starpu_data_acquire
int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_data_access_mode mode)
starpu_data_advise_as_important
void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important)
starpu_data_get_default_sequential_consistency_flag
unsigned starpu_data_get_default_sequential_consistency_flag(void)
starpu_data_can_evict
int starpu_data_can_evict(starpu_data_handle_t handle, unsigned node, enum starpu_is_prefetch is_prefetch)
starpu_memchunk_tidy
void starpu_memchunk_tidy(unsigned memory_node)
starpu_data_acquire_on_node_cb_sequential_consistency
int starpu_data_acquire_on_node_cb_sequential_consistency(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg, int sequential_consistency)
starpu_data_wont_use
void starpu_data_wont_use(starpu_data_handle_t handle)
STARPU_NOFOOTPRINT
@ STARPU_NOFOOTPRINT
Definition starpu_data.h:148
STARPU_MPI_REDUX
@ STARPU_MPI_REDUX
Definition starpu_data.h:133
STARPU_SCRATCH
@ STARPU_SCRATCH
Definition starpu_data.h:61
STARPU_ACCESS_MODE_MAX
@ STARPU_ACCESS_MODE_MAX
Definition starpu_data.h:150
STARPU_SSEND
@ STARPU_SSEND
Definition starpu_data.h:114
STARPU_W
@ STARPU_W
Definition starpu_data.h:59
STARPU_RW
@ STARPU_RW
Definition starpu_data.h:60
STARPU_REDUX
@ STARPU_REDUX
Definition starpu_data.h:88
STARPU_R
@ STARPU_R
Definition starpu_data.h:58
STARPU_UNMAP
@ STARPU_UNMAP
Definition starpu_data.h:146
STARPU_COMMUTE
@ STARPU_COMMUTE
Definition starpu_data.h:102
STARPU_LOCALITY
@ STARPU_LOCALITY
Definition starpu_data.h:119
STARPU_NOPLAN
@ STARPU_NOPLAN
Definition starpu_data.h:143
STARPU_NONE
@ STARPU_NONE
Definition starpu_data.h:57
STARPU_TASK_PREFETCH
@ STARPU_TASK_PREFETCH
Definition starpu_data.h:490
STARPU_PREFETCH
@ STARPU_PREFETCH
Definition starpu_data.h:492
STARPU_IDLEFETCH
@ STARPU_IDLEFETCH
Definition starpu_data.h:494
STARPU_FETCH
@ STARPU_FETCH
Definition starpu_data.h:488
STARPU_ATTRIBUTE_MALLOC
#define STARPU_ATTRIBUTE_MALLOC
Definition starpu_util.h:129
starpu.h