1 | /******************************************************************************* |
---|---|
2 | * Copyright 2019-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 | #include "gpu/gpu_impl_list.hpp" |
18 | |
19 | #include "gpu/jit/reorder/gen_reorder.hpp" |
20 | #include "gpu/ocl/cross_engine_reorder.hpp" |
21 | #include "gpu/ocl/custom_reorder.hpp" |
22 | #include "gpu/ocl/generic_reorder.hpp" |
23 | #include "gpu/ocl/ref_reorder.hpp" |
24 | #include "gpu/ocl/rnn/rnn_reorders.hpp" |
25 | |
26 | namespace dnnl { |
27 | namespace impl { |
28 | namespace gpu { |
29 | |
30 | namespace { |
31 | |
32 | using namespace dnnl::impl::data_type; |
33 | |
34 | #define REORDER_INSTANCE(...) \ |
35 | impl_list_item_t( \ |
36 | impl_list_item_t::reorder_type_deduction_helper_t<__VA_ARGS__>()), |
37 | |
38 | // clang-format off |
39 | constexpr impl_list_item_t reorder_impl_list[] = REG_REORDER_P({ |
40 | REORDER_INSTANCE(ocl::rnn_weights_reorder_t::pd_t) |
41 | REORDER_INSTANCE(ocl::cross_engine_reorder_t::pd_t) |
42 | REORDER_INSTANCE(jit::gen_reorder_t::pd_t) |
43 | REORDER_INSTANCE(ocl::custom_reorder_t::pd_t) // for specific tensor shapes |
44 | REORDER_INSTANCE(ocl::generic_reorder_t::pd_t)// fast and quite generic |
45 | REORDER_INSTANCE(ocl::ref_reorder_t::pd_t) // slow but fits every use case |
46 | nullptr, |
47 | }); |
48 | // clang-format on |
49 | |
50 | } // namespace |
51 | |
52 | const impl_list_item_t *gpu_impl_list_t::get_reorder_implementation_list( |
53 | const memory_desc_t *, const memory_desc_t *) { |
54 | return reorder_impl_list; |
55 | } |
56 | |
57 | } // namespace gpu |
58 | } // namespace impl |
59 | } // namespace dnnl |
60 |