starpu_data_filters.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 <stdarg.h>
  21. #include <starpu.h>
  22. #include <starpu_config.h>
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. struct starpu_data_interface_ops_t;
  27. struct starpu_data_filter {
  28. void (*filter_func)(void *father_interface, void *child_interface, struct starpu_data_filter *, unsigned id, unsigned nparts);
  29. unsigned (*get_nchildren)(struct starpu_data_filter *, starpu_data_handle initial_handle);
  30. struct starpu_data_interface_ops_t *(*get_child_ops)(struct starpu_data_filter *, unsigned id);
  31. unsigned filter_arg;
  32. unsigned nchildren;
  33. void *filter_arg_ptr;
  34. };
  35. void starpu_data_partition(starpu_data_handle initial_handle, struct starpu_data_filter *f);
  36. void starpu_data_unpartition(starpu_data_handle root_data, uint32_t gathering_node);
  37. int starpu_data_get_nb_children(starpu_data_handle handle);
  38. starpu_data_handle starpu_data_get_child(starpu_data_handle handle, unsigned i);
  39. /* unsigned list */
  40. starpu_data_handle starpu_data_get_sub_data(starpu_data_handle root_data, unsigned depth, ... );
  41. /* Same, but using va_list */
  42. starpu_data_handle starpu_data_vget_sub_data(starpu_data_handle root_data, unsigned depth, va_list pa );
  43. /* struct starpu_data_filter * list */
  44. void starpu_data_map_filters(starpu_data_handle root_data, unsigned nfilters, ...);
  45. /* Same, but using va_list */
  46. void starpu_data_vmap_filters(starpu_data_handle root_data, unsigned nfilters, va_list pa);
  47. /* a few examples of filters */
  48. /* for BCSR */
  49. void starpu_canonical_block_filter_bcsr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  50. void starpu_vertical_block_filter_func_csr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  51. /* (filters for BLAS interface) */
  52. void starpu_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  53. void starpu_vertical_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  54. /* for vector */
  55. void starpu_block_filter_func_vector(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  56. void starpu_vector_list_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  57. void starpu_vector_divide_in_2_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  58. /* for block */
  59. void starpu_block_filter_func_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif