StarPU Handbook - StarPU Introduction
starpu_profiling_tool.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2022-2022 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  * Copyright (C) 2022-2022 Camille Coti
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 
18 #ifndef __STARPU_PROFILING_TOOL_H__
19 #define __STARPU_PROFILING_TOOL_H__
20 
21 #include <starpu.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
36 {
37  starpu_prof_tool_event_none = 0,
38  starpu_prof_tool_event_init,
39  starpu_prof_tool_event_terminate,
40  starpu_prof_tool_event_init_begin,
41  starpu_prof_tool_event_init_end,
42 
43  starpu_prof_tool_event_driver_init,
44  starpu_prof_tool_event_driver_deinit,
45  starpu_prof_tool_event_driver_init_start,
46  starpu_prof_tool_event_driver_init_end,
47  starpu_prof_tool_event_start_cpu_exec,
48  starpu_prof_tool_event_end_cpu_exec,
49  starpu_prof_tool_event_start_gpu_exec,
50  starpu_prof_tool_event_end_gpu_exec,
51  starpu_prof_tool_event_start_transfer,
52  starpu_prof_tool_event_end_transfer,
53 
54  starpu_prof_tool_event_user_start,
55  starpu_prof_tool_event_user_end
56 };
57 
58 enum starpu_prof_tool_driver_type
59 {
60  starpu_prof_tool_driver_cpu,
61  starpu_prof_tool_driver_gpu,
62  starpu_prof_tool_driver_hip,
63  starpu_prof_tool_driver_ocl
64 };
65 
66 enum starpu_prof_tool_command
67 {
68  starpu_prof_tool_command_reg = 0,
69  starpu_prof_tool_command_toggle = 1,
70  starpu_prof_tool_command_toggle_per_thread = 2
71 };
72 
77 {
78  struct starpu_conf *conf;
79  enum starpu_prof_tool_event event_type;
80  unsigned int starpu_version[3];
81  int thread_id;
82  int worker_id;
83 
84  int device_number;
85  enum starpu_prof_tool_driver_type driver_type; // not sure
86 
87  unsigned memnode;
88  unsigned bytes_to_transfer;
89  unsigned bytes_transfered;
90 
91  void* fun_ptr; /* NULL when not relevant (driver init etc) */
92 
93  /* int valid_bytes;
94  int version;
95  starpu_device_t device_type;
96  int device_number;
97  starpu_ssize_t async;
98  starpu_ssize_t async_queue;
99  const char* src_file;
100  const char* func_name;
101  int line_no, end_line_no;
102  int func_line_no, func_end_line_no;*/
103 };
104 
109 {
110  enum starpu_prof_tool_event event_type;
111  /* starpu_data_event_info data_event;
112  starpu_launch_event_info launch_event;
113  starpu_other_event_info other_event;*/
114 };
115 
120 {
121  /*acc_device_api device_api;
122  int valid_bytes;
123  acc_device_t device_type;
124  int vendor;
125  const void* device_handle;
126  const void* context_handle;
127  const void* async_handle;*/
128 };
129 
130 typedef void (*starpu_prof_tool_cb_func)(struct starpu_prof_tool_info*, union starpu_prof_tool_event_info*, struct starpu_prof_tool_api_info*);
131 
135 typedef void (*starpu_prof_tool_entry_register_func)(enum starpu_prof_tool_event event_type, starpu_prof_tool_cb_func cb, enum starpu_prof_tool_command info);
136 
141 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* __STARPU_PROFILING_TOOL_H__ */
Definition: starpu.h:110
void(* starpu_prof_tool_entry_register_func)(enum starpu_prof_tool_event event_type, starpu_prof_tool_cb_func cb, enum starpu_prof_tool_command info)
Definition: starpu_profiling_tool.h:135
starpu_prof_tool_event
Definition: starpu_profiling_tool.h:36
void(* starpu_prof_tool_entry_func)(starpu_prof_tool_entry_register_func reg, starpu_prof_tool_entry_register_func unreg)
Definition: starpu_profiling_tool.h:140
Definition: starpu_profiling_tool.h:120
Definition: starpu_profiling_tool.h:77
Definition: starpu_profiling_tool.h:109