starpu_perf_steering.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2019 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_PERF_STEERING_H__
  17. #define __STARPU_PERF_STEERING_H__
  18. #include <starpu.h>
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. /**
  24. @defgroup API_Perf_Steering Perf_Steering
  25. @{
  26. */
  27. enum starpu_perf_knob_scope
  28. {
  29. starpu_perf_knob_scope_undefined = 0,
  30. starpu_perf_knob_scope_global = 1,
  31. starpu_perf_knob_scope_per_worker = 3,
  32. starpu_perf_knob_scope_per_scheduler = 5
  33. };
  34. enum starpu_perf_knob_type
  35. {
  36. starpu_perf_knob_type_undefined = 0,
  37. starpu_perf_knob_type_int32 = 1,
  38. starpu_perf_knob_type_int64 = 2,
  39. starpu_perf_knob_type_float = 3,
  40. starpu_perf_knob_type_double = 4
  41. };
  42. int starpu_perf_knob_scope_name_to_id(const char *name);
  43. const char *starpu_perf_knob_scope_id_to_name(enum starpu_perf_knob_scope scope);
  44. int starpu_perf_knob_type_name_to_id(const char *name);
  45. const char *starpu_perf_knob_type_id_to_name(enum starpu_perf_knob_type type);
  46. int starpu_perf_knob_nb(enum starpu_perf_knob_scope scope);
  47. int starpu_perf_knob_name_to_id(enum starpu_perf_knob_scope scope, const char *name);
  48. int starpu_perf_knob_nth_to_id(enum starpu_perf_knob_scope scope, int nth);
  49. const char *starpu_perf_knob_id_to_name(int id);
  50. int starpu_perf_knob_get_type_id(int id);
  51. const char *starpu_perf_knob_get_help_string(int id);
  52. void starpu_perf_knob_list_avail(enum starpu_perf_knob_scope scope);
  53. void starpu_perf_knob_list_all_avail(void);
  54. int32_t starpu_perf_knob_get_global_int32_value (const int knob_id);
  55. int64_t starpu_perf_knob_get_global_int64_value (const int knob_id);
  56. float starpu_perf_knob_get_global_float_value (const int knob_id);
  57. double starpu_perf_knob_get_global_double_value(const int knob_id);
  58. void starpu_perf_knob_set_global_int32_value (const int knob_id, int32_t new_value);
  59. void starpu_perf_knob_set_global_int64_value (const int knob_id, int64_t new_value);
  60. void starpu_perf_knob_set_global_float_value (const int knob_id, float new_value);
  61. void starpu_perf_knob_set_global_double_value(const int knob_id, double new_value);
  62. int32_t starpu_perf_knob_get_per_worker_int32_value (const int knob_id, unsigned workerid);
  63. int64_t starpu_perf_knob_get_per_worker_int64_value (const int knob_id, unsigned workerid);
  64. float starpu_perf_knob_get_per_worker_float_value (const int knob_id, unsigned workerid);
  65. double starpu_perf_knob_get_per_worker_double_value(const int knob_id, unsigned workerid);
  66. void starpu_perf_knob_set_per_worker_int32_value (const int knob_id, unsigned workerid, int32_t new_value);
  67. void starpu_perf_knob_set_per_worker_int64_value (const int knob_id, unsigned workerid, int64_t new_value);
  68. void starpu_perf_knob_set_per_worker_float_value (const int knob_id, unsigned workerid, float new_value);
  69. void starpu_perf_knob_set_per_worker_double_value(const int knob_id, unsigned workerid, double new_value);
  70. int32_t starpu_perf_knob_get_per_scheduler_int32_value (const int knob_id, const char * sched_policy_name);
  71. int64_t starpu_perf_knob_get_per_scheduler_int64_value (const int knob_id, const char * sched_policy_name);
  72. float starpu_perf_knob_get_per_scheduler_float_value (const int knob_id, const char * sched_policy_name);
  73. double starpu_perf_knob_get_per_scheduler_double_value(const int knob_id, const char * sched_policy_name);
  74. void starpu_perf_knob_set_per_scheduler_int32_value (const int knob_id, const char * sched_policy_name, int32_t new_value);
  75. void starpu_perf_knob_set_per_scheduler_int64_value (const int knob_id, const char * sched_policy_name, int64_t new_value);
  76. void starpu_perf_knob_set_per_scheduler_float_value (const int knob_id, const char * sched_policy_name, float new_value);
  77. void starpu_perf_knob_set_per_scheduler_double_value(const int knob_id, const char * sched_policy_name, double new_value);
  78. /** @} */
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* __STARPU_PERF_STEERING_H__ */