driver_disk.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2013,2017 CNRS
  4. * Copyright (C) 2013 Inria
  5. * Copyright (C) 2013 Université de Bordeaux
  6. * Copyright (C) 2013 Corentin Salingue
  7. *
  8. * StarPU is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * StarPU is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. */
  19. #include <starpu.h>
  20. #include <core/disk.h>
  21. #include <starpu_profiling.h>
  22. #include <drivers/disk/driver_disk.h>
  23. int _starpu_disk_copy_src_to_disk(void * src, unsigned src_node, void * dst, size_t dst_offset, unsigned dst_node, size_t size, void * async_channel)
  24. {
  25. STARPU_ASSERT(starpu_node_get_kind(src_node) == STARPU_CPU_RAM);
  26. return _starpu_disk_write(src_node, dst_node, dst, src, dst_offset, size, async_channel);
  27. }
  28. int _starpu_disk_copy_disk_to_src(void * src, size_t src_offset, unsigned src_node, void * dst, unsigned dst_node, size_t size, void * async_channel)
  29. {
  30. STARPU_ASSERT(starpu_node_get_kind(dst_node) == STARPU_CPU_RAM);
  31. return _starpu_disk_read(src_node, dst_node, src, dst, src_offset, size, async_channel);
  32. }
  33. int _starpu_disk_copy_disk_to_disk(void * src, size_t src_offset, unsigned src_node, void * dst, size_t dst_offset, unsigned dst_node, size_t size, void * async_channel)
  34. {
  35. STARPU_ASSERT(starpu_node_get_kind(src_node) == STARPU_DISK_RAM && starpu_node_get_kind(dst_node) == STARPU_DISK_RAM);
  36. return _starpu_disk_copy(src_node, src, src_offset,
  37. dst_node, dst, dst_offset,
  38. size, async_channel);
  39. }