StarPU Internal Handbook
disk.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2013-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 * Copyright (C) 2013 Corentin Salingue
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 __DISK_H__
19#define __DISK_H__
20
23#define STARPU_DISK_ALL 1
24#define STARPU_DISK_NO_RECLAIM 2
25
26#ifdef __cplusplus
27extern "C"
28{
29#endif
30
32#include <datawizard/malloc.h>
33
34#pragma GCC visibility push(hidden)
35
37void * _starpu_disk_alloc (unsigned node, size_t size) STARPU_ATTRIBUTE_MALLOC;
38
39void _starpu_disk_free (unsigned node, void *obj, size_t size);
41int _starpu_disk_read(unsigned src_node, unsigned dst_node, void *obj, void *buf, off_t offset, size_t size, struct _starpu_async_channel * async_channel);
43int _starpu_disk_write(unsigned src_node, unsigned dst_node, void *obj, void *buf, off_t offset, size_t size, struct _starpu_async_channel * async_channel);
44
45int _starpu_disk_full_read(unsigned src_node, unsigned dst_node, void * obj, void ** ptr, size_t * size, struct _starpu_async_channel * async_channel);
46int _starpu_disk_full_write(unsigned src_node, unsigned dst_node, void * obj, void * ptr, size_t size, struct _starpu_async_channel * async_channel);
47
48int _starpu_disk_copy(unsigned node_src, void* obj_src, off_t offset_src, unsigned node_dst, void* obj_dst, off_t offset_dst, size_t size, struct _starpu_async_channel * async_channel);
49
54void starpu_disk_free_request(struct _starpu_async_channel *async_channel);
55
57int _starpu_disk_can_copy(unsigned node1, unsigned node2);
58
60void _starpu_set_disk_flag(unsigned node, int flag);
61int _starpu_get_disk_flag(unsigned node);
62
65
66void _starpu_swap_init(void);
67
68static inline struct _starpu_disk_event *_starpu_disk_get_event(union _starpu_async_channel_event *_event)
69{
70 struct _starpu_disk_event *event;
71 STARPU_STATIC_ASSERT(sizeof(*event) <= sizeof(*_event));
72 event = (struct _starpu_disk_event *) _event;
73 return event;
74}
75
76#ifdef __cplusplus
77}
78#endif
79
80#pragma GCC visibility pop
81
82#endif /* __DISK_H__ */
Definition: copy_driver.h:71
Definition: copy_driver.h:53
Definition: copy_driver.h:66
int starpu_disk_test_request(struct _starpu_async_channel *async_channel)
int _starpu_disk_write(unsigned src_node, unsigned dst_node, void *obj, void *buf, off_t offset, size_t size, struct _starpu_async_channel *async_channel)
void _starpu_set_disk_flag(unsigned node, int flag)
void starpu_disk_wait_request(struct _starpu_async_channel *async_channel)
void _starpu_disk_unregister(void)
void * _starpu_disk_alloc(unsigned node, size_t size) STARPU_ATTRIBUTE_MALLOC
int _starpu_disk_can_copy(unsigned node1, unsigned node2)
int _starpu_disk_read(unsigned src_node, unsigned dst_node, void *obj, void *buf, off_t offset, size_t size, struct _starpu_async_channel *async_channel)