1 | /******************************************************************************* |
2 | * Copyright 2022 Intel Corporation |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | *******************************************************************************/ |
16 | |
17 | #ifndef GPU_PROFILE_HPP |
18 | #define GPU_PROFILE_HPP |
19 | |
20 | #include <unordered_map> |
21 | |
22 | #include "common/c_types_map.hpp" |
23 | |
24 | namespace dnnl { |
25 | namespace impl { |
26 | namespace gpu { |
27 | |
28 | enum class profile_mode_t : int { |
29 | sum = 0, |
30 | min = 1, |
31 | }; |
32 | |
33 | struct profile_entry_t { |
34 | uint64_t nsec = 0; |
35 | double freq = 0; |
36 | int kernel_count = 0; |
37 | }; |
38 | |
39 | bool is_profiling_enabled(); |
40 | |
41 | status_t get_profile_info_impl(uint64_t &nsec, double &freq, int mode, |
42 | const std::unordered_map<uint64_t, profile_entry_t> &entries); |
43 | |
44 | } // namespace gpu |
45 | } // namespace impl |
46 | } // namespace dnnl |
47 | |
48 | #endif |
49 | |