perfmodel.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009, 2010, 2011 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011 Télécom-SudParis
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef __PERFMODEL_H__
  19. #define __PERFMODEL_H__
  20. #include <common/config.h>
  21. #include <starpu.h>
  22. #include <starpu_perfmodel.h>
  23. #include <common/htable32.h>
  24. #include <core/task_bundle.h>
  25. #include <pthread.h>
  26. #include <stdio.h>
  27. struct starpu_buffer_descr;
  28. struct _starpu_job;
  29. enum starpu_perf_archtype;
  30. void _starpu_get_perf_model_dir(char *path, size_t maxlen);
  31. void _starpu_get_perf_model_dir_codelets(char *path, size_t maxlen);
  32. void _starpu_get_perf_model_dir_bus(char *path, size_t maxlen);
  33. void _starpu_get_perf_model_dir_debug(char *path, size_t maxlen);
  34. double _starpu_history_based_job_expected_perf(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, struct _starpu_job *j, unsigned nimpl);
  35. int _starpu_register_model(struct starpu_perfmodel *model);
  36. void _starpu_load_history_based_model(struct starpu_perfmodel *model, unsigned scan_history);
  37. void _starpu_load_perfmodel(struct starpu_perfmodel *model);
  38. void _starpu_initialize_registered_performance_models(void);
  39. void _starpu_deinitialize_registered_performance_models(void);
  40. double _starpu_regression_based_job_expected_perf(struct starpu_perfmodel *model,
  41. enum starpu_perf_archtype arch, struct _starpu_job *j, unsigned nimpl);
  42. double _starpu_non_linear_regression_based_job_expected_perf(struct starpu_perfmodel *model,
  43. enum starpu_perf_archtype arch, struct _starpu_job *j, unsigned nimpl);
  44. void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfmodel *model, enum starpu_perf_archtype arch,
  45. unsigned cpuid, double measured, unsigned nimpl);
  46. void _starpu_create_sampling_directory_if_needed(void);
  47. void _starpu_load_bus_performance_files(void);
  48. double _starpu_predict_transfer_time(unsigned src_node, unsigned dst_node, size_t size);
  49. void _starpu_set_calibrate_flag(unsigned val);
  50. unsigned _starpu_get_calibrate_flag(void);
  51. #if defined(STARPU_USE_CUDA)
  52. int *_starpu_get_cuda_affinity_vector(unsigned gpuid);
  53. #endif
  54. #if defined(STARPU_USE_OPENCL)
  55. int *_starpu_get_opencl_affinity_vector(unsigned gpuid);
  56. #endif
  57. #endif // __PERFMODEL_H__