1 | /******************************************************************************* |
2 | * Copyright 2022 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 GPU_JIT_CONV_NORMALIZATION_HPP |
18 | #define GPU_JIT_CONV_NORMALIZATION_HPP |
19 | |
20 | #include <vector> |
21 | |
22 | #include "gpu/jit/ir/tensor.hpp" |
23 | |
24 | namespace dnnl { |
25 | namespace impl { |
26 | namespace gpu { |
27 | namespace jit { |
28 | |
29 | std::vector<dim_t> normalize_conv_dims(std::vector<dim_t> &dims, |
30 | bool with_groups, int groups, bool is_dw, int reduced_dim, |
31 | bool fuse_spatial, bool add_groups, bool is_wei); |
32 | |
33 | layout_t normalize_conv_layout(const layout_t &_layout, bool with_groups, |
34 | int groups, bool is_dw, int reduced_dim, bool fuse_spatial, |
35 | bool add_groups, bool is_wei); |
36 | |
37 | void normalize_conv_layouts(layout_t &src_layout, layout_t &wei_layout, |
38 | layout_t &dst_layout, layout_t &bia_layout, bool with_groups, int g, |
39 | int ic, int oc, bool is_dw, int reduced_dim, bool fuse_spatial, |
40 | bool add_groups); |
41 | |
42 | inline void normalize_conv_layouts(layout_t &src_layout, layout_t &wei_layout, |
43 | layout_t &dst_layout, bool with_groups, int g, int ic, int oc, |
44 | bool is_dw, int reduced_dim, bool fuse_spatial, bool add_groups) { |
45 | layout_t bia_layout; |
46 | normalize_conv_layouts(src_layout, wei_layout, dst_layout, bia_layout, |
47 | with_groups, g, ic, oc, is_dw, reduced_dim, fuse_spatial, |
48 | add_groups); |
49 | } |
50 | |
51 | } // namespace jit |
52 | } // namespace gpu |
53 | } // namespace impl |
54 | } // namespace dnnl |
55 | |
56 | #endif |
57 | |