1 /*******************************************************************************
2 * Copyright 2016-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.
15 *******************************************************************************/
17 #ifndef CPU_ENGINE_HPP
18 #define CPU_ENGINE_HPP
24 #include "c_types_map.hpp"
25 #include "../common/engine.hpp"
31 class cpu_engine_t: public engine_t {
33 cpu_engine_t(): engine_t(engine_kind::cpu) {}
35 virtual status_t submit(primitive_t *p, event_t *e,
36 event_vector &prerequisites);
38 /* implementation part */
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);
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;
55 class cpu_engine_factory_t: public engine_factory_t {
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 {
61 *engine = new cpu_engine_t();
62 return status::success;
66 extern cpu_engine_factory_t engine_factory;
74 // vim: et ts=4 sw=4 cindent cino^=l0,\:0,N-s