starpu_data_filters.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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_FILTERS_H__
  17. #define __STARPU_DATA_FILTERS_H__
  18. #include <starpu.h>
  19. #include <starpu_config.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. struct starpu_data_interface_ops_t;
  24. typedef struct starpu_filter_t {
  25. void (*filter_func)(void *father_interface, void *child_interface, struct starpu_filter_t *, unsigned id, unsigned nparts);
  26. unsigned (*get_nchildren)(struct starpu_filter_t *, starpu_data_handle initial_handle);
  27. struct starpu_data_interface_ops_t *(*get_child_ops)(struct starpu_filter_t *, unsigned id);
  28. unsigned filter_arg;
  29. unsigned nchildren;
  30. void *filter_arg_ptr;
  31. } starpu_filter;
  32. void starpu_data_partition(starpu_data_handle initial_handle, starpu_filter *f);
  33. void starpu_data_unpartition(starpu_data_handle root_data, uint32_t gathering_node);
  34. void starpu_data_create_children(starpu_data_handle handle, unsigned nchildren, starpu_filter *f);
  35. starpu_data_handle starpu_data_get_child(starpu_data_handle handle, unsigned i);
  36. /* unsigned list */
  37. starpu_data_handle starpu_data_get_sub_data(starpu_data_handle root_data, unsigned depth, ... );
  38. /* starpu_filter * list */
  39. void starpu_map_filters(starpu_data_handle root_data, unsigned nfilters, ...);
  40. /* a few examples of filters */
  41. /* for BCSR */
  42. void starpu_canonical_block_filter_bcsr(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  43. void starpu_vertical_block_filter_func_csr(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  44. /* (filters for BLAS interface) */
  45. void starpu_block_filter_func(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  46. void starpu_vertical_block_filter_func(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  47. /* for vector */
  48. void starpu_block_filter_func_vector(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  49. void starpu_vector_list_filter_func(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  50. void starpu_vector_divide_in_2_filter_func(void *father_interface, void *child_interface, starpu_filter *f, unsigned id, unsigned nparts);
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif