starpu-data.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * StarPU
  3. * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  4. *
  5. * This program 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. * This program 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 __STARPU_DATA_H__
  17. #define __STARPU_DATA_H__
  18. #include <starpu_config.h>
  19. #include <starpu-data-interfaces.h>
  20. #include <starpu-data-filters.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. struct starpu_data_state_t;
  25. typedef enum {
  26. STARPU_R,
  27. STARPU_W,
  28. STARPU_RW
  29. } starpu_access_mode;
  30. typedef struct starpu_buffer_descr_t {
  31. starpu_data_handle handle;
  32. starpu_access_mode mode;
  33. } starpu_buffer_descr;
  34. void starpu_unpartition_data(struct starpu_data_state_t *root_data, uint32_t gathering_node);
  35. void starpu_delete_data(struct starpu_data_state_t *state);
  36. void starpu_advise_if_data_is_important(struct starpu_data_state_t *state, unsigned is_important);
  37. int starpu_sync_data_with_mem(struct starpu_data_state_t *state);
  38. int starpu_notify_data_modification(struct starpu_data_state_t *state, uint32_t modifying_node);
  39. int starpu_malloc_pinned_if_possible(void **A, size_t dim);
  40. int starpu_free_pinned_if_possible(void *A);
  41. int starpu_request_data_allocation(struct starpu_data_state_t *state, uint32_t node);
  42. int starpu_prefetch_data_on_node(struct starpu_data_state_t *state, unsigned node, unsigned async);
  43. unsigned starpu_get_worker_memory_node(unsigned workerid);
  44. /* It is possible to associate a mask to a piece of data (and its children) so
  45. * that when it is modified, it is automatically transfered into those memory
  46. * node. For instance a (1<<0) write-back mask means that the CUDA workers will
  47. * commit their changes in main memory (node 0). */
  48. void starpu_data_set_wb_mask(struct starpu_data_state_t *state, uint32_t wb_mask);
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif // __STARPU_DATA_H__