starpu_top.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 William Braik, Yann Courtois, Jean-Marie Couteyen, Anthony
  4. * Roy
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef __STARPU_TOP_H__
  18. #define __STARPU_TOP_H__
  19. #include <starpu.h>
  20. #include <stdlib.h>
  21. #include <time.h>
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. enum starpu_top_data_type
  27. {
  28. STARPU_TOP_DATA_BOOLEAN,
  29. STARPU_TOP_DATA_INTEGER,
  30. STARPU_TOP_DATA_FLOAT
  31. };
  32. struct starpu_top_data
  33. {
  34. unsigned int id;
  35. const char *name;
  36. int int_min_value;
  37. int int_max_value;
  38. double double_min_value;
  39. double double_max_value;
  40. int active;
  41. enum starpu_top_data_type type;
  42. struct starpu_top_data *next;
  43. };
  44. enum starpu_top_param_type
  45. {
  46. STARPU_TOP_PARAM_BOOLEAN,
  47. STARPU_TOP_PARAM_INTEGER,
  48. STARPU_TOP_PARAM_FLOAT,
  49. STARPU_TOP_PARAM_ENUM
  50. };
  51. struct starpu_top_param
  52. {
  53. unsigned int id;
  54. const char *name;
  55. enum starpu_top_param_type type;
  56. void *value;
  57. char **enum_values;
  58. int nb_values;
  59. void (*callback)(struct starpu_top_param*);
  60. int int_min_value;
  61. int int_max_value;
  62. double double_min_value;
  63. double double_max_value;
  64. struct starpu_top_param *next;
  65. };
  66. enum starpu_top_message_type
  67. {
  68. TOP_TYPE_GO,
  69. TOP_TYPE_SET,
  70. TOP_TYPE_CONTINUE,
  71. TOP_TYPE_ENABLE,
  72. TOP_TYPE_DISABLE,
  73. TOP_TYPE_DEBUG,
  74. TOP_TYPE_UNKNOW
  75. };
  76. struct starpu_top_data *starpu_top_add_data_boolean(const char *data_name,
  77. int active);
  78. struct starpu_top_data *starpu_top_add_data_integer(const char *data_name,
  79. int minimum_value,
  80. int maximum_value,
  81. int active);
  82. struct starpu_top_data *starpu_top_add_data_float(const char *data_name,
  83. double minimum_value,
  84. double maximum_value,
  85. int active);
  86. struct starpu_top_param *starpu_top_register_parameter_boolean(const char *param_name,
  87. int *parameter_field,
  88. void (*callback)(struct starpu_top_param*));
  89. struct starpu_top_param *starpu_top_register_parameter_integer(const char *param_name,
  90. int *parameter_field,
  91. int minimum_value,
  92. int maximum_value,
  93. void (*callback)(struct starpu_top_param*));
  94. struct starpu_top_param *starpu_top_register_parameter_float(const char *param_name,
  95. double *parameter_field,
  96. double minimum_value,
  97. double maximum_value,
  98. void (*callback)(struct starpu_top_param*));
  99. struct starpu_top_param *starpu_top_register_parameter_enum(const char *param_name,
  100. int *parameter_field,
  101. char **values,
  102. int nb_values,
  103. void (*callback)(struct starpu_top_param*));
  104. void starpu_top_init_and_wait(const char *server_name);
  105. void starpu_top_update_parameter(const struct starpu_top_param *param);
  106. void starpu_top_update_data_boolean(const struct starpu_top_data *data,
  107. int value);
  108. void starpu_top_update_data_integer(const struct starpu_top_data *data,
  109. int value);
  110. void starpu_top_update_data_float(const struct starpu_top_data *data,
  111. double value);
  112. void starpu_top_task_prevision(struct starpu_task *task,
  113. int devid, unsigned long long start,
  114. unsigned long long end);
  115. void starpu_top_debug_log(const char *message);
  116. void starpu_top_debug_lock(const char *message);
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120. #endif /* __STARPU_TOP_H__ */