1 | /******************************************************************************* |
2 | * Copyright 2020-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 "cpu/cpu_engine.hpp" |
18 | |
19 | #include "cpu/ref_reduction.hpp" |
20 | |
21 | #if DNNL_X64 |
22 | #include "cpu/x64/jit_uni_reduction.hpp" |
23 | using namespace dnnl::impl::cpu::x64; |
24 | #endif |
25 | |
26 | namespace dnnl { |
27 | namespace impl { |
28 | namespace cpu { |
29 | |
30 | namespace { |
31 | using namespace dnnl::impl::data_type; |
32 | |
33 | // clang-format off |
34 | constexpr impl_list_item_t impl_list[] = REG_REDUCTION_P({ |
35 | CPU_INSTANCE_X64(jit_uni_reduction_t) |
36 | |
37 | CPU_INSTANCE(ref_reduction_t<f32, f32, f32>) |
38 | CPU_INSTANCE(ref_reduction_t<bf16, bf16, f32>) |
39 | CPU_INSTANCE(ref_reduction_t<bf16, f32, f32>) |
40 | CPU_INSTANCE(ref_reduction_t<f16, f16, f32>) |
41 | CPU_INSTANCE(ref_reduction_t<f16, f32, f32>) |
42 | CPU_INSTANCE(ref_reduction_t<s8, s8, s32>) |
43 | CPU_INSTANCE(ref_reduction_t<s8, s32, s32>) |
44 | CPU_INSTANCE(ref_reduction_t<s8, f32, s32>) |
45 | CPU_INSTANCE(ref_reduction_t<u8, u8, s32>) |
46 | CPU_INSTANCE(ref_reduction_t<u8, s32, s32>) |
47 | CPU_INSTANCE(ref_reduction_t<u8, f32, s32>) |
48 | /* eol */ |
49 | nullptr, |
50 | }); |
51 | // clang-format on |
52 | } //namespace |
53 | |
54 | const impl_list_item_t *get_reduction_impl_list(const reduction_desc_t *desc) { |
55 | UNUSED(desc); |
56 | return impl_list; |
57 | }; |
58 | |
59 | } // namespace cpu |
60 | } // namespace impl |
61 | } // namespace dnnl |
62 | |