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_REORDER_PD_HPP |
18 | #define CPU_REORDER_PD_HPP |
19 | |
20 | #include <assert.h> |
21 | |
22 | #include "c_types_map.hpp" |
23 | #include "reorder_pd.hpp" |
24 | #include "utils.hpp" |
25 | |
26 | namespace mkldnn { |
27 | namespace impl { |
28 | namespace cpu { |
29 | |
30 | struct cpu_reorder_pd_t: public reorder_pd_t { |
31 | using reorder_pd_t::reorder_pd_t; |
32 | |
33 | status_t init() { |
34 | const auto &post_ops = attr()->post_ops_; |
35 | bool args_ok = IMPLICATION(post_ops.len_ != 0, post_ops.len_ == 1 |
36 | && post_ops.entry_[0].kind == primitive_kind::sum); |
37 | scratchpad_engine_ = src_engine_; |
38 | return args_ok ? status::success : status::unimplemented; |
39 | } |
40 | }; |
41 | |
42 | } |
43 | } |
44 | } |
45 | |
46 | #endif |
47 | |
48 | // vim: et ts=4 sw=4 cindent cino^=l0,\:0,N-s |
49 | |