generic.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 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 MULTIFORMAT_GENERIC_H
  17. #define MULTIFORMAT_GENERIC_H
  18. #include <starpu_mic.h>
  19. #define NX 16
  20. #ifdef STARPU_USE_CPU
  21. void cpu_func(void *buffers[], void *args);
  22. #endif /* !STARPU_USE_CPU */
  23. #ifdef STARPU_USE_CUDA
  24. void cuda_func(void *buffers[], void *args);
  25. #endif /* !STARPU_USE_CUDA */
  26. #ifdef STARPU_USE_OPENCL
  27. void opencl_func(void *buffers[], void *args);
  28. #endif /* !STARPU_USE_OPENCL */
  29. #ifdef STARPU_USE_MIC
  30. starpu_mic_kernel_t mic_func();
  31. #endif
  32. extern struct starpu_multiformat_data_interface_ops ops;
  33. /* Counting the calls to the codelets */
  34. struct stats
  35. {
  36. #ifdef STARPU_USE_CPU
  37. unsigned int cpu;
  38. #endif
  39. #ifdef STARPU_USE_CUDA
  40. unsigned int cuda;
  41. unsigned int cpu_to_cuda;
  42. unsigned int cuda_to_cpu;
  43. #endif
  44. #ifdef STARPU_USE_OPENCL
  45. unsigned int opencl;
  46. unsigned int cpu_to_opencl;
  47. unsigned int opencl_to_cpu;
  48. #endif
  49. #ifdef STARPU_USE_MIC
  50. unsigned int mic;
  51. unsigned int cpu_to_mic;
  52. unsigned int mic_to_cpu;
  53. #endif
  54. };
  55. void print_stats(struct stats *);
  56. void reset_stats(struct stats *);
  57. int compare_stats(struct stats *, struct stats *);
  58. #endif /* !MULTIFORMAT_GENERIC_H */