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_OCL_MDAPI_UTILS_HPP |
18 | #define GPU_OCL_MDAPI_UTILS_HPP |
19 | |
20 | #include <memory> |
21 | #include <CL/cl.h> |
22 | |
23 | namespace dnnl { |
24 | namespace impl { |
25 | namespace gpu { |
26 | namespace ocl { |
27 | |
28 | class mdapi_helper_impl_t; |
29 | |
30 | class mdapi_helper_t { |
31 | public: |
32 | mdapi_helper_t(); |
33 | cl_command_queue create_queue( |
34 | cl_context cl_ctx, cl_device_id dev, cl_int *err) const; |
35 | double get_freq(cl_event event) const; |
36 | |
37 | private: |
38 | std::shared_ptr<mdapi_helper_impl_t> impl_; |
39 | }; |
40 | |
41 | } // namespace ocl |
42 | } // namespace gpu |
43 | } // namespace impl |
44 | } // namespace dnnl |
45 | |
46 | #endif |
47 | |