source_common.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2012-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. * Copyright (C) 2013 Thibaut Lambert
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef __SOURCE_COMMON_H__
  18. #define __SOURCE_COMMON_H__
  19. /** @file */
  20. #ifdef STARPU_USE_MP
  21. #include <core/sched_policy.h>
  22. #include <core/task.h>
  23. #include <drivers/mp_common/mp_common.h>
  24. enum _starpu_mp_command _starpu_src_common_wait_command_sync(struct _starpu_mp_node *node, void ** arg, int* arg_size);
  25. int _starpu_src_common_store_message(struct _starpu_mp_node *node, void * arg, int arg_size, enum _starpu_mp_command answer);
  26. enum _starpu_mp_command _starpu_src_common_wait_completed_execution(struct _starpu_mp_node *node, int devid, void **arg, int * arg_size);
  27. int _starpu_src_common_sink_nbcores(struct _starpu_mp_node *node, int *buf);
  28. int _starpu_src_common_lookup(const struct _starpu_mp_node *node, void (**func_ptr)(void), const char *func_name);
  29. int _starpu_src_common_allocate(const struct _starpu_mp_node *mp_node, void **addr, size_t size);
  30. void _starpu_src_common_free(struct _starpu_mp_node *mp_node, void *addr);
  31. int _starpu_src_common_execute_kernel(const struct _starpu_mp_node *node,
  32. void (*kernel)(void), unsigned coreid,
  33. enum starpu_codelet_type type,
  34. int is_parallel_task, int cb_workerid,
  35. starpu_data_handle_t *handles,
  36. void **interfaces,
  37. unsigned nb_interfaces,
  38. void *cl_arg, size_t cl_arg_size, int detached);
  39. int _starpu_src_common_copy_host_to_sink_sync(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size);
  40. int _starpu_src_common_copy_sink_to_host_sync(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size);
  41. int _starpu_src_common_copy_sink_to_sink_sync(struct _starpu_mp_node *src_node, struct _starpu_mp_node *dst_node, void *src, void *dst, size_t size);
  42. int _starpu_src_common_copy_host_to_sink_async(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size, void *event);
  43. int _starpu_src_common_copy_sink_to_host_async(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size, void *event);
  44. int _starpu_src_common_copy_sink_to_sink_async(struct _starpu_mp_node *src_node, struct _starpu_mp_node *dst_node, void *src, void *dst, size_t size, void *event);
  45. int _starpu_src_common_locate_file(char *located_file_name, size_t len,
  46. const char *env_file_name, const char *env_mic_path,
  47. const char *config_file_name, const char *actual_file_name,
  48. const char **suffixes);
  49. void _starpu_src_common_worker(struct _starpu_worker_set * worker_set, unsigned baseworkerid, struct _starpu_mp_node * node_set);
  50. #if defined(STARPU_USE_MPI_MASTER_SLAVE) && !defined(STARPU_MPI_MASTER_SLAVE_MULTIPLE_THREAD)
  51. void _starpu_src_common_init_switch_env(unsigned this);
  52. void _starpu_src_common_workers_set(struct _starpu_worker_set * worker_set, int ndevices, struct _starpu_mp_node ** mp_node);
  53. #endif
  54. #endif /* STARPU_USE_MP */
  55. #endif /* __SOURCE_COMMON_H__ */