memstats.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2020 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 __MEMSTATS_H__
  17. #define __MEMSTATS_H__
  18. /** @file */
  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__ */