starpu_data_filters.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2011 Université de Bordeaux 1
  4. * Copyright (C) 2010 Mehdi Juhoor <mjuhoor@gmail.com>
  5. * Copyright (C) 2010 Centre National de la Recherche Scientifique
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef __STARPU_DATA_FILTERS_H__
  19. #define __STARPU_DATA_FILTERS_H__
  20. #include <starpu.h>
  21. #include <starpu_config.h>
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. struct starpu_data_interface_ops_t;
  26. struct starpu_data_filter {
  27. void (*filter_func)(void *father_interface, void *child_interface, struct starpu_data_filter *, unsigned id, unsigned nparts);
  28. unsigned (*get_nchildren)(struct starpu_data_filter *, starpu_data_handle initial_handle);
  29. struct starpu_data_interface_ops_t *(*get_child_ops)(struct starpu_data_filter *, unsigned id);
  30. unsigned filter_arg;
  31. unsigned nchildren;
  32. void *filter_arg_ptr;
  33. };
  34. void starpu_data_partition(starpu_data_handle initial_handle, struct starpu_data_filter *f);
  35. void starpu_data_unpartition(starpu_data_handle root_data, uint32_t gathering_node);
  36. int starpu_data_get_nb_children(starpu_data_handle handle);
  37. starpu_data_handle starpu_data_get_child(starpu_data_handle handle, unsigned i);
  38. /* unsigned list */
  39. starpu_data_handle starpu_data_get_sub_data(starpu_data_handle root_data, unsigned depth, ... );
  40. /* Same, but using va_list */
  41. starpu_data_handle starpu_data_vget_sub_data(starpu_data_handle root_data, unsigned depth, va_list pa );
  42. /* struct starpu_data_filter * list */
  43. void starpu_data_map_filters(starpu_data_handle root_data, unsigned nfilters, ...);
  44. /* Same, but using va_list */
  45. void starpu_data_vmap_filters(starpu_data_handle root_data, unsigned nfilters, va_list pa);
  46. /* a few examples of filters */
  47. /* for BCSR */
  48. void starpu_canonical_block_filter_bcsr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  49. void starpu_vertical_block_filter_func_csr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  50. /* (filters for BLAS interface) */
  51. void starpu_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  52. void starpu_vertical_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  53. /* for vector */
  54. void starpu_block_filter_func_vector(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  55. void starpu_vector_list_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  56. void starpu_vector_divide_in_2_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  57. /* for block */
  58. void starpu_block_filter_func_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif