starpu_data_filters.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010 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. /* struct starpu_data_filter * list */
  41. void starpu_data_map_filters(starpu_data_handle root_data, unsigned nfilters, ...);
  42. /* a few examples of filters */
  43. /* for BCSR */
  44. void starpu_canonical_block_filter_bcsr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  45. void starpu_vertical_block_filter_func_csr(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  46. /* (filters for BLAS interface) */
  47. void starpu_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  48. void starpu_vertical_block_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  49. /* for vector */
  50. void starpu_block_filter_func_vector(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  51. void starpu_vector_list_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  52. void starpu_vector_divide_in_2_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  53. /* for block */
  54. void starpu_block_filter_func_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif