1 | /******************************************************************************* |
2 | * Copyright 2020 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_X64_LRN_JIT_AVX512_COMMON_UTILS_HPP |
18 | #define CPU_X64_LRN_JIT_AVX512_COMMON_UTILS_HPP |
19 | |
20 | namespace dnnl { |
21 | namespace impl { |
22 | namespace cpu { |
23 | namespace x64 { |
24 | namespace lrn { |
25 | |
26 | #define IRB_LOOP(statement) \ |
27 | for (int irb = 0; irb < loop_size; irb++) { \ |
28 | statement; \ |
29 | } |
30 | |
31 | enum class direction { forward, backward }; |
32 | |
33 | enum class across_version : char { First, Middle, Last, Single }; |
34 | |
35 | struct nChw16c_across_t { |
36 | int H, W; |
37 | across_version version; |
38 | constexpr nChw16c_across_t(int h, int w, across_version version) |
39 | : H(h), W(w), version(version) {} |
40 | }; |
41 | |
42 | enum class tail_mode { NoTail, NextTail, CurrentTail }; |
43 | |
44 | } // namespace lrn |
45 | } // namespace x64 |
46 | } // namespace cpu |
47 | } // namespace impl |
48 | } // namespace dnnl |
49 | |
50 | #endif |
51 | |