source_common.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2012 Inria
  4. *
  5. * StarPU 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. * StarPU 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 __SOURCE_COMMON_H__
  17. #define __SOURCE_COMMON_H__
  18. #ifdef STARPU_USE_MP
  19. #include <core/sched_policy.h>
  20. #include <core/task.h>
  21. #include <drivers/mp_common/mp_common.h>
  22. enum _starpu_mp_command _starpu_src_common_wait_command_sync(struct _starpu_mp_node *node,
  23. void ** arg, int* arg_size);
  24. void _starpu_src_common_recv_async(struct _starpu_worker_set *worker_set,
  25. struct _starpu_mp_node * baseworker_node);
  26. int _starpu_src_common_store_message(struct _starpu_mp_node *node,
  27. void * arg, int arg_size, enum _starpu_mp_command answer);
  28. enum _starpu_mp_command _starpu_src_common_wait_completed_execution(struct _starpu_mp_node *node, int devid, void **arg, int * arg_size);
  29. int _starpu_src_common_sink_nbcores (const struct _starpu_mp_node *node, int *buf);
  30. int _starpu_src_common_lookup(const struct _starpu_mp_node *node,
  31. void (**func_ptr)(void), const char *func_name);
  32. int _starpu_src_common_allocate(const struct _starpu_mp_node *mp_node,
  33. void **addr, size_t size);
  34. void _starpu_src_common_free(const struct _starpu_mp_node *mp_node,
  35. void *addr);
  36. int _starpu_src_common_execute_kernel(const struct _starpu_mp_node *node,
  37. void (*kernel)(void), unsigned coreid,
  38. enum starpu_codelet_type type,
  39. int is_parallel_task, int cb_workerid,
  40. starpu_data_handle_t *handles,
  41. void **interfaces,
  42. unsigned nb_interfaces,
  43. void *cl_arg, size_t cl_arg_size);
  44. int _starpu_src_common_copy_host_to_sink(const struct _starpu_mp_node *mp_node,
  45. void *src, void *dst, size_t size);
  46. int _starpu_src_common_copy_sink_to_host(const struct _starpu_mp_node *mp_node,
  47. void *src, void *dst, size_t size);
  48. int _starpu_src_common_copy_sink_to_sink(const struct _starpu_mp_node *src_node,
  49. const struct _starpu_mp_node *dst_node, void *src, void *dst, size_t size);
  50. int _starpu_src_common_locate_file(char *located_file_name,
  51. const char *env_file_name, const char *env_mic_path,
  52. const char *config_file_name, const char *actual_file_name,
  53. const char **suffixes);
  54. void _starpu_src_common_worker(struct _starpu_worker_set * worker_set,
  55. unsigned baseworkerid,
  56. struct _starpu_mp_node * node_set);
  57. #endif /* STARPU_USE_MP */
  58. #endif /* __SOURCE_COMMON_H__ */