starpu_top.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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, int active);
  77. struct starpu_top_data *starpu_top_add_data_integer(const char *data_name, int minimum_value, int maximum_value, int active);
  78. struct starpu_top_data *starpu_top_add_data_float(const char *data_name, double minimum_value, double maximum_value, int active);
  79. struct starpu_top_param *starpu_top_register_parameter_boolean(const char *param_name, int *parameter_field, void (*callback)(struct starpu_top_param*));
  80. struct starpu_top_param *starpu_top_register_parameter_integer(const char *param_name, int *parameter_field, int minimum_value, int maximum_value, void (*callback)(struct starpu_top_param*));
  81. struct starpu_top_param *starpu_top_register_parameter_float(const char *param_name, double *parameter_field, double minimum_value, double maximum_value, void (*callback)(struct starpu_top_param*));
  82. struct starpu_top_param *starpu_top_register_parameter_enum(const char *param_name, int *parameter_field, char **values, int nb_values, void (*callback)(struct starpu_top_param*));
  83. void starpu_top_init_and_wait(const char *server_name);
  84. void starpu_top_update_parameter(const struct starpu_top_param *param);
  85. void starpu_top_update_data_boolean(const struct starpu_top_data *data, int value);
  86. void starpu_top_update_data_integer(const struct starpu_top_data *data, int value);
  87. void starpu_top_update_data_float(const struct starpu_top_data *data, double value);
  88. void starpu_top_task_prevision(struct starpu_task *task, int devid, unsigned long long start, unsigned long long end);
  89. void starpu_top_debug_log(const char *message);
  90. void starpu_top_debug_lock(const char *message);
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94. #endif /* __STARPU_TOP_H__ */