starpu-data.h 2.2 KB

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