disk.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2013 Corentin Salingue
  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. #ifndef __DISK_H__
  17. #define __DISK_H__
  18. #define SIZE_DISK_MIN (1024*1024)
  19. #define STARPU_DISK_ALL 1
  20. #define STARPU_DISK_NO_RECLAIM 2
  21. /* interface to manipulate memory disk */
  22. void * _starpu_disk_alloc (unsigned node, size_t size);
  23. void _starpu_disk_free (unsigned node, void *obj, size_t size);
  24. /* src_node is a disk node, dst_node is for the moment the STARPU_MAIN_RAM */
  25. int _starpu_disk_read(unsigned src_node, unsigned dst_node, void *obj, void *buf, off_t offset, size_t size, void * async_channel);
  26. /* src_node is for the moment the STARU_MAIN_RAM, dst_node is a disk node */
  27. int _starpu_disk_write(unsigned src_node, unsigned dst_node, void *obj, void *buf, off_t offset, size_t size, void * async_channel);
  28. int _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, void * async_channel);
  29. void starpu_disk_wait_request(struct _starpu_async_channel *async_channel);
  30. /* interface to compare memory disk */
  31. int _starpu_is_same_kind_disk(unsigned node1, unsigned node2);
  32. /* change disk flag */
  33. void _starpu_set_disk_flag(unsigned node, int flag);
  34. int _starpu_get_disk_flag(unsigned node);
  35. /* unregister disk */
  36. void _starpu_disk_unregister(void);
  37. #endif /* __DISK_H__ */