starpu_data.h
Go to the documentation of this file.
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2009-2022 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
*
* 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_NOPLAN=(1<<8),
STARPU_ACCESS_MODE_MAX=(1<<9)
};
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_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_quick(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg, int sequential_consistency, int quick);
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)(void *), void *arg, int sequential_consistency, int quick, long *pre_sync_jobid, long *post_sync_jobid);
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);
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);
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);
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_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);
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);
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);
#ifdef __cplusplus
}
#endif
#endif /* __STARPU_DATA_H__ */
starpu_codelet
Definition: starpu_task.h:250
starpu_data_interface_ops::name
char * name
Definition: starpu_data_interfaces.h:568
starpu_data_interface_ops
Definition: starpu_data_interfaces.h:366
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_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:55
starpu_data_set_sequential_consistency_flag
void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag)
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_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_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_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_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_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_set_coordinates
void starpu_data_set_coordinates(starpu_data_handle_t handle, unsigned dimensions,...)
starpu_arbiter_t
struct starpu_arbiter * starpu_arbiter_t
Definition: starpu_data.h:384
starpu_data_request_allocation
int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned 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:44
starpu_data_release
void starpu_data_release(starpu_data_handle_t handle)
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)(void *), void *arg, int sequential_consistency, int quick, long *pre_sync_jobid, long *post_sync_jobid)
starpu_data_set_wt_mask
void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask)
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_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_SCRATCH
@ STARPU_SCRATCH
Definition: starpu_data.h:60
STARPU_ACCESS_MODE_MAX
@ STARPU_ACCESS_MODE_MAX
Definition: starpu_data.h:128
STARPU_SSEND
@ STARPU_SSEND
Definition: starpu_data.h:109
STARPU_W
@ STARPU_W
Definition: starpu_data.h:58
STARPU_RW
@ STARPU_RW
Definition: starpu_data.h:59
STARPU_REDUX
@ STARPU_REDUX
Definition: starpu_data.h:85
STARPU_R
@ STARPU_R
Definition: starpu_data.h:57
STARPU_COMMUTE
@ STARPU_COMMUTE
Definition: starpu_data.h:99
STARPU_LOCALITY
@ STARPU_LOCALITY
Definition: starpu_data.h:114
STARPU_NOPLAN
@ STARPU_NOPLAN
Definition: starpu_data.h:126
STARPU_NONE
@ STARPU_NONE
Definition: starpu_data.h:56
STARPU_ATTRIBUTE_MALLOC
#define STARPU_ATTRIBUTE_MALLOC
Definition: starpu_util.h:112
starpu.h