Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / src / gpu / kernel_runner.h
1 /*
2 // Copyright (c) 2016 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 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #pragma once
19
20 #include "engine_impl.h"
21 #include "kernel_selector_common.h"
22 #include "kernel_runner_interface.h"
23 #include "kernel.h"
24
25 namespace cldnn { namespace gpu {
26
27 class kernel_runner : public kernel_selector::KernelRunnerInterface
28 {
29 public:
30
31     kernel_runner(engine_impl& engine_ref, bool weights_and_bias_exist = false);
32
33     std::vector<uint64_t> run_kernels(const kernel_selector::KernelsData& kernelsData) override;
34
35 private:
36
37     const int compilation_batch_size = 50;
38     const int runs_per_kernel = 3;
39
40     void prepare_kernel_args(const kernel_selector::KernelsData& kernels_data, gpu::kernel::kernel_arguments_data& args);
41
42     engine_impl::ptr engine;
43     bool weights_and_bias_exist;
44     std::vector<memory_impl::cptr> input_buffers;
45     std::vector<memory_impl::ptr> output_buffers;
46     std::vector<memory_impl::cptr> weight_buffers;
47     std::vector<memory_impl::cptr> bias_buffers;
48 };
49
50 //////////////////////////////////////////////////////////////////////////////////////////////////////////
51 }}