2 // Copyright (c) 2018 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include "ocl_base_event.h"
20 #include "api/CPP/profiling.hpp"
26 #pragma warning(disable : 4250) // Visual Studio warns us about inheritance via dominance but it's done intentionally
33 struct user_event : public base_event, public cldnn::user_event {
34 explicit user_event(std::shared_ptr<gpu_toolkit> ctx) : base_event(ctx), cldnn::user_event(false) {}
36 void set_impl() override;
37 void attach_event(bool set) {
38 _event = cl::UserEvent(get_context()->context());
39 // we need to reset the timer(since attach_ocl_event is called only when this object is being reused)
40 _timer = cldnn::instrumentation::timer<>();
46 bool get_profiling_info_impl(std::list<cldnn_profiling_interval>& info) override;
49 cldnn::instrumentation::timer<> _timer;
50 std::unique_ptr<cldnn::instrumentation::profiling_period_basic> _duration;