node_ops.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2008-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), 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 __NODE_OPS_H__
  17. #define __NODE_OPS_H__
  18. /** @file */
  19. #include <starpu.h>
  20. #include <common/config.h>
  21. #include <datawizard/copy_driver.h>
  22. typedef int (*copy_interface_func_t)(starpu_data_handle_t handle, void *src_interface, unsigned src_node,
  23. void *dst_interface, unsigned dst_node,
  24. struct _starpu_data_request *req);
  25. typedef int (*copy_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
  26. uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
  27. size_t ssize, struct _starpu_async_channel *async_channel);
  28. typedef int (*copy2d_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
  29. uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
  30. size_t blocksize,
  31. size_t numblocks, size_t ld_src, size_t ld_dst,
  32. struct _starpu_async_channel *async_channel);
  33. typedef int (*copy3d_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
  34. uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
  35. size_t blocksize,
  36. size_t numblocks_1, size_t ld1_src, size_t ld1_dst,
  37. size_t numblocks_2, size_t ld2_src, size_t ld2_dst,
  38. struct _starpu_async_channel *async_channel);
  39. struct _starpu_node_ops
  40. {
  41. copy_interface_func_t copy_interface_to[STARPU_MPI_MS_RAM+1];
  42. copy_data_t copy_data_to[STARPU_MPI_MS_RAM+1];
  43. copy2d_data_t copy2d_data_to[STARPU_MPI_MS_RAM+1];
  44. copy3d_data_t copy3d_data_to[STARPU_MPI_MS_RAM+1];
  45. void (*wait_request_completion)(struct _starpu_async_channel *async_channel);
  46. unsigned (*test_request_completion)(struct _starpu_async_channel *async_channel);
  47. int (*is_direct_access_supported)(unsigned node, unsigned handling_node);
  48. uintptr_t (*malloc_on_node)(unsigned dst_node, size_t size, int flags);
  49. void (*free_on_node)(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  50. char *name;
  51. };
  52. const char* _starpu_node_get_prefix(enum starpu_node_kind kind);
  53. #endif // __NODE_OPS_H__