memstats.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012,2015,2017 CNRS
  4. * Copyright (C) 2009-2010,2014 Université de Bordeaux
  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 __MEMSTATS_H__
  18. #define __MEMSTATS_H__
  19. #include <starpu.h>
  20. #include <common/config.h>
  21. #ifdef STARPU_MEMORY_STATS
  22. struct _starpu_memory_stats
  23. {
  24. /* Handle access stats per node */
  25. unsigned direct_access[STARPU_MAXNODES];
  26. unsigned loaded_shared[STARPU_MAXNODES];
  27. unsigned loaded_owner[STARPU_MAXNODES];
  28. unsigned shared_to_owner[STARPU_MAXNODES];
  29. unsigned invalidated[STARPU_MAXNODES];
  30. };
  31. typedef struct _starpu_memory_stats * _starpu_memory_stats_t;
  32. #else
  33. typedef void * _starpu_memory_stats_t;
  34. #endif
  35. void _starpu_memory_stats_init(starpu_data_handle_t handle);
  36. void _starpu_memory_stats_init_per_node(starpu_data_handle_t handle, unsigned node);
  37. void _starpu_memory_stats_free(starpu_data_handle_t handle);
  38. void _starpu_memory_display_handle_stats(FILE *stream, starpu_data_handle_t handle);
  39. void _starpu_memory_handle_stats_cache_hit(starpu_data_handle_t handle, unsigned node);
  40. void _starpu_memory_handle_stats_loaded_shared(starpu_data_handle_t handle, unsigned node);
  41. void _starpu_memory_handle_stats_loaded_owner(starpu_data_handle_t handle, unsigned node);
  42. void _starpu_memory_handle_stats_shared_to_owner(starpu_data_handle_t handle, unsigned node);
  43. void _starpu_memory_handle_stats_invalidated(starpu_data_handle_t handle, unsigned node);
  44. #endif /* __MEMSTATS_H__ */