starpu_heteroprio.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2015-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), 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 __STARPU_SCHEDULER_HETEROPRIO_H__
  17. #define __STARPU_SCHEDULER_HETEROPRIO_H__
  18. #include <starpu.h>
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. #define STARPU_HETEROPRIO_MAX_PRIO 100
  24. #define STARPU_HETEROPRIO_MAX_PREFETCH 2
  25. #if STARPU_HETEROPRIO_MAX_PREFETCH <= 0
  26. #error STARPU_HETEROPRIO_MAX_PREFETCH == 1 means no prefetch so STARPU_HETEROPRIO_MAX_PREFETCH must >= 1
  27. #endif
  28. /** Tell how many prio there are for a given arch */
  29. void starpu_heteroprio_set_nb_prios(unsigned sched_ctx_id, enum starpu_worker_archtype arch, unsigned max_prio);
  30. /** Set the mapping for a given arch prio=>bucket */
  31. void starpu_heteroprio_set_mapping(unsigned sched_ctx_id, enum starpu_worker_archtype arch, unsigned source_prio, unsigned dest_bucket_id);
  32. /** Tell which arch is the faster for the tasks of a bucket (optional) */
  33. void starpu_heteroprio_set_faster_arch(unsigned sched_ctx_id, enum starpu_worker_archtype arch, unsigned bucket_id);
  34. /** Tell how slow is a arch for the tasks of a bucket (optional) */
  35. void starpu_heteroprio_set_arch_slow_factor(unsigned sched_ctx_id, enum starpu_worker_archtype arch, unsigned bucket_id, float slow_factor);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* __STARPU_SCHEDULER_HETEROPRIO_H__ */