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 "common/impl_list_item.hpp"
20#include "common/utils.hpp"
21#include "gpu/gpu_sum_pd.hpp"
22#include "gpu/jit/gen9_simple_sum.hpp"
23#include "gpu/ocl/gen9_sum.hpp"
24#include "gpu/ocl/many_inputs_sum.hpp"
25#include "gpu/ocl/ref_sum.hpp"
26#include "gpu/ocl/simple_sum.hpp"
27
28namespace dnnl {
29namespace impl {
30namespace gpu {
31
32namespace {
33// TODO: Re-enable nGEN-based implementation after architecture
34// dispatching is implemented.
35// INSTANCE(jit::gen9_simple_sum_t)
36#define SUM_INSTANCE(...) \
37 impl_list_item_t(impl_list_item_t::sum_type_deduction_helper_t< \
38 __VA_ARGS__::pd_t>()),
39
40// clang-format off
41constexpr impl_list_item_t sum_impl_list[] = REG_SUM_P({
42 SUM_INSTANCE(ocl::gen9_sum_t)
43 SUM_INSTANCE(ocl::many_inputs_sum_t)
44 SUM_INSTANCE(ocl::simple_sum_t<data_type::f32>)
45 SUM_INSTANCE(ocl::ref_sum_t)
46 nullptr,
47});
48// clang-format on
49#undef INSTANCE
50} // namespace
51
52const impl_list_item_t *gpu_impl_list_t::get_sum_implementation_list() {
53 return sum_impl_list;
54}
55
56} // namespace gpu
57} // namespace impl
58} // namespace dnnl
59