starpu_data_filters.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * StarPU
  3. * Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (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. struct starpu_data_filter {
  25. void (*filter_func)(void *father_interface, void *child_interface, struct starpu_data_filter *, unsigned id, unsigned nparts);
  26. unsigned (*get_nchildren)(struct starpu_data_filter *, starpu_data_handle initial_handle);
  27. struct starpu_data_interface_ops_t *(*get_child_ops)(struct starpu_data_filter *, unsigned id);
  28. unsigned filter_arg;
  29. unsigned nchildren;
  30. void *filter_arg_ptr;
  31. };
  32. void starpu_data_partition(starpu_data_handle initial_handle, struct starpu_data_filter *f);
  33. void starpu_data_unpartition(starpu_data_handle root_data, uint32_t gathering_node);
  34. int starpu_data_get_nb_children(starpu_data_handle handle);
  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. /* struct starpu_data_filter * list */
  39. void starpu_data_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, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  43. void starpu_vertical_block_filter_func_csr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  44. /* (filters for BLAS interface) */
  45. void starpu_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  46. void starpu_vertical_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  47. /* for vector */
  48. void starpu_block_filter_func_vector(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  49. void starpu_vector_list_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  50. void starpu_vector_divide_in_2_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  51. /* for block */
  52. void starpu_block_filter_func_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif