node_ops.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2008-2011,2014,2017 Université de Bordeaux
  4. * Copyright (C) 2016,2017 Inria
  5. * Copyright (C) 2010,2013,2015,2017,2019 CNRS
  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 __NODE_OPS_H__
  19. #define __NODE_OPS_H__
  20. #include <starpu.h>
  21. #include <common/config.h>
  22. #include <datawizard/copy_driver.h>
  23. typedef int (*copy_data_func_t)(starpu_data_handle_t handle, void *src_interface, unsigned src_node,
  24. void *dst_interface, unsigned dst_node,
  25. struct _starpu_data_request *req);
  26. typedef int (*copy_interface_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
  27. uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
  28. size_t ssize, struct _starpu_async_channel *async_channel);
  29. struct _starpu_node_ops
  30. {
  31. copy_data_func_t copy_data_to[STARPU_MPI_MS_RAM+1];
  32. copy_interface_t copy_interface;
  33. void (*wait_request_completion)(struct _starpu_async_channel *async_channel);
  34. unsigned (*test_request_completion)(struct _starpu_async_channel *async_channel);
  35. int (*direct_access_supported)(unsigned node, unsigned handling_node);
  36. uintptr_t (*malloc_on_node)(unsigned dst_node, size_t size, int flags);
  37. void (*free_on_node)(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  38. };
  39. extern struct _starpu_node_ops _node_ops[STARPU_MPI_MS_RAM+1];
  40. void _starpu_node_ops_init();
  41. const char* _starpu_node_get_prefix(enum starpu_node_kind kind);
  42. #endif // __NODE_OPS_H__