copy_driver.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  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 __COPY_DRIVER_H__
  18. #define __COPY_DRIVER_H__
  19. #include <common/config.h>
  20. #include <datawizard/memory_nodes.h>
  21. #include "coherency.h"
  22. #include "memalloc.h"
  23. #ifdef STARPU_USE_CUDA
  24. #include <cuda.h>
  25. #include <cuda_runtime.h>
  26. #include <cublas.h>
  27. #endif
  28. #ifdef STARPU_USE_OPENCL
  29. #include <starpu_opencl.h>
  30. #endif
  31. struct _starpu_data_request;
  32. struct _starpu_data_replicate;
  33. /* this is a structure that can be queried to see whether an asynchronous
  34. * transfer has terminated or not */
  35. union _starpu_async_channel_event
  36. {
  37. int dummy;
  38. #ifdef STARPU_USE_CUDA
  39. cudaEvent_t cuda_event;
  40. #endif
  41. #ifdef STARPU_USE_OPENCL
  42. cl_event opencl_event;
  43. #endif
  44. };
  45. struct _starpu_async_channel
  46. {
  47. union _starpu_async_channel_event event;
  48. enum starpu_node_kind type;
  49. };
  50. void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid);
  51. int _starpu_driver_copy_data_1_to_1(starpu_data_handle_t handle,
  52. struct _starpu_data_replicate *src_replicate,
  53. struct _starpu_data_replicate *dst_replicate,
  54. unsigned donotread,
  55. struct _starpu_data_request *req,
  56. unsigned may_alloc);
  57. unsigned _starpu_driver_test_request_completion(struct _starpu_async_channel *async_channel);
  58. void _starpu_driver_wait_request_completion(struct _starpu_async_channel *async_channel);
  59. #endif // __COPY_DRIVER_H__