updated readme file due to moving CMake scripts to the root folder
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / src / cpu / cpu_engine.hpp
1 /*******************************************************************************
2 * Copyright 2016-2018 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 CPU_ENGINE_HPP
18 #define CPU_ENGINE_HPP
19
20 #include <assert.h>
21
22 #include "mkldnn.h"
23
24 #include "c_types_map.hpp"
25 #include "../common/engine.hpp"
26
27 namespace mkldnn {
28 namespace impl {
29 namespace cpu {
30
31 class cpu_engine_t: public engine_t {
32 public:
33     cpu_engine_t(): engine_t(engine_kind::cpu) {}
34
35     virtual status_t submit(primitive_t *p, event_t *e,
36             event_vector &prerequisites);
37
38     /* implementation part */
39
40     virtual status_t memory_primitive_desc_create(memory_pd_t **memory_pd,
41             const memory_desc_t *memory_d);
42     virtual status_t view_primitive_desc_create(view_pd_t **view_pd,
43             const memory_pd_t *memory_pd, const dims_t dims,
44             const dims_t offsets);
45
46     virtual const concat_primitive_desc_create_f*
47         get_concat_implementation_list() const;
48     virtual const reorder_primitive_desc_create_f*
49         get_reorder_implementation_list() const;
50     virtual const sum_primitive_desc_create_f*
51         get_sum_implementation_list() const;
52     virtual const primitive_desc_create_f* get_implementation_list() const;
53 };
54
55 class cpu_engine_factory_t: public engine_factory_t {
56 public:
57     virtual size_t count() const { return 1; }
58     virtual engine_kind_t kind() const { return engine_kind::cpu; }
59     virtual status_t engine_create(engine_t **engine, size_t index) const {
60         assert(index == 0);
61         *engine = new cpu_engine_t();
62         return status::success;
63     };
64 };
65
66 extern cpu_engine_factory_t engine_factory;
67
68 }
69 }
70 }
71
72 #endif
73
74 // vim: et ts=4 sw=4 cindent cino^=l0,\:0,N-s