generic.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011,2012 Inria
  4. * Copyright (C) 2011,2012,2015,2017 CNRS
  5. * Copyright (C) 2013 Université de Bordeaux
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef MULTIFORMAT_GENERIC_H
  19. #define MULTIFORMAT_GENERIC_H
  20. #include <starpu_mic.h>
  21. #define NX 16
  22. #ifdef STARPU_USE_CPU
  23. void cpu_func(void *buffers[], void *args);
  24. #endif /* !STARPU_USE_CPU */
  25. #ifdef STARPU_USE_CUDA
  26. void cuda_func(void *buffers[], void *args);
  27. #endif /* !STARPU_USE_CUDA */
  28. #ifdef STARPU_USE_OPENCL
  29. void opencl_func(void *buffers[], void *args);
  30. #endif /* !STARPU_USE_OPENCL */
  31. #ifdef STARPU_USE_MIC
  32. starpu_mic_kernel_t mic_func();
  33. #endif
  34. extern struct starpu_multiformat_data_interface_ops ops;
  35. /* Counting the calls to the codelets */
  36. struct stats
  37. {
  38. #ifdef STARPU_USE_CPU
  39. unsigned int cpu;
  40. #endif
  41. #ifdef STARPU_USE_CUDA
  42. unsigned int cuda;
  43. unsigned int cpu_to_cuda;
  44. unsigned int cuda_to_cpu;
  45. #endif
  46. #ifdef STARPU_USE_OPENCL
  47. unsigned int opencl;
  48. unsigned int cpu_to_opencl;
  49. unsigned int opencl_to_cpu;
  50. #endif
  51. #ifdef STARPU_USE_MIC
  52. unsigned int mic;
  53. unsigned int cpu_to_mic;
  54. unsigned int mic_to_cpu;
  55. #endif
  56. };
  57. void print_stats(struct stats *);
  58. void reset_stats(struct stats *);
  59. int compare_stats(struct stats *, struct stats *);
  60. #endif /* !MULTIFORMAT_GENERIC_H */