1 | /******************************************************************************* |
2 | * Copyright 2021-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 CPU_X64_RNN_BRGEMM_CELL_COMMON_REORDERS_HPP |
18 | #define CPU_X64_RNN_BRGEMM_CELL_COMMON_REORDERS_HPP |
19 | |
20 | #include "cpu/x64/jit_brgemm_transpose_utils.hpp" |
21 | #include "cpu/x64/rnn/jit_brgemm_transpose_single_row.hpp" |
22 | |
23 | namespace dnnl { |
24 | namespace impl { |
25 | namespace cpu { |
26 | |
27 | namespace rnn_utils { |
28 | struct rnn_conf_t; |
29 | } |
30 | namespace x64 { |
31 | struct src_layer_iter_transpose_t { |
32 | src_layer_iter_transpose_t(const int src_ld, const int dst_ld, |
33 | const int rows, const int cols, |
34 | jit_brgemm_trans_src_t *const kernel_transpose); |
35 | |
36 | template <typename Dt> |
37 | void execute(const Dt *src, Dt *dst) const; |
38 | |
39 | private: |
40 | const int src_ld_; |
41 | const int dst_ld_; |
42 | const int src_rows_; |
43 | const int src_cols_; |
44 | jit_brgemm_trans_src_t *const kernel_transpose_; |
45 | }; |
46 | |
47 | } // namespace x64 |
48 | } // namespace cpu |
49 | } // namespace impl |
50 | } // namespace dnnl |
51 | |
52 | #endif |
53 | |