node_ops.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2008-2021 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. #pragma GCC visibility push(hidden)
  23. typedef int (*copy_interface_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_data_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. typedef int (*copy2d_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
  30. uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
  31. size_t blocksize,
  32. size_t numblocks, size_t ld_src, size_t ld_dst,
  33. struct _starpu_async_channel *async_channel);
  34. typedef int (*copy3d_data_t)(uintptr_t src_ptr, size_t src_offset, unsigned src_node,
  35. uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node,
  36. size_t blocksize,
  37. size_t numblocks_1, size_t ld1_src, size_t ld1_dst,
  38. size_t numblocks_2, size_t ld2_src, size_t ld2_dst,
  39. struct _starpu_async_channel *async_channel);
  40. struct _starpu_node_ops
  41. {
  42. copy_interface_func_t copy_interface_to[STARPU_MAX_RAM+1];
  43. copy_data_t copy_data_to[STARPU_MAX_RAM+1];
  44. copy2d_data_t copy2d_data_to[STARPU_MAX_RAM+1];
  45. copy3d_data_t copy3d_data_to[STARPU_MAX_RAM+1];
  46. void (*wait_request_completion)(struct _starpu_async_channel *async_channel);
  47. unsigned (*test_request_completion)(struct _starpu_async_channel *async_channel);
  48. int (*is_direct_access_supported)(unsigned node, unsigned handling_node);
  49. uintptr_t (*malloc_on_node)(unsigned dst_node, size_t size, int flags);
  50. void (*free_on_node)(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  51. char *name;
  52. };
  53. const char* _starpu_node_get_prefix(enum starpu_node_kind kind);
  54. #pragma GCC visibility pop
  55. #endif // __NODE_OPS_H__