copy_driver.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * StarPU
  3. * Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (see AUTHORS file)
  4. *
  5. * This program 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. * This program 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 __COPY_DRIVER_H__
  17. #define __COPY_DRIVER_H__
  18. #include <common/config.h>
  19. #include <datawizard/memory_nodes.h>
  20. #include "coherency.h"
  21. #include "memalloc.h"
  22. #ifdef STARPU_USE_CUDA
  23. #include <cuda.h>
  24. #include <cuda_runtime.h>
  25. #include <cublas.h>
  26. #endif
  27. #ifdef STARPU_USE_OPENCL
  28. #include <CL/cl.h>
  29. #endif
  30. struct starpu_data_request_s;
  31. struct starpu_data_replicate_s;
  32. /* this is a structure that can be queried to see whether an asynchronous
  33. * transfer has terminated or not */
  34. typedef union {
  35. int dummy;
  36. #ifdef STARPU_USE_CUDA
  37. cudaEvent_t cuda_event;
  38. #endif
  39. #ifdef STARPU_USE_OPENCL
  40. cl_event opencl_event;
  41. #endif
  42. } starpu_async_channel;
  43. void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid);
  44. int _starpu_driver_copy_data_1_to_1(starpu_data_handle handle,
  45. struct starpu_data_replicate_s *src_replicate,
  46. struct starpu_data_replicate_s *dst_replicate,
  47. unsigned donotread,
  48. struct starpu_data_request_s *req,
  49. unsigned may_alloc);
  50. unsigned _starpu_driver_test_request_completion(starpu_async_channel *async_channel, unsigned handling_node);
  51. void _starpu_driver_wait_request_completion(starpu_async_channel *async_channel, unsigned handling_node);
  52. #endif // __COPY_DRIVER_H__