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#ifndef CPU_X64_JIT_AVX512_CORE_RESAMPLING_HPP
18#define CPU_X64_JIT_AVX512_CORE_RESAMPLING_HPP
19
20#include "common/c_types_map.hpp"
21#include "common/primitive.hpp"
22
23#include "cpu/cpu_resampling_pd.hpp"
24#include "cpu/x64/cpu_isa_traits.hpp"
25
26#include "cpu/x64/jit_generator.hpp"
27
28namespace dnnl {
29namespace impl {
30namespace cpu {
31namespace x64 {
32
33struct jit_resampling_args_t;
34
35struct jit_avx512_core_resampling_kernel_base_t : public jit_generator {
36 jit_avx512_core_resampling_kernel_base_t(
37 const resampling_pd_t *pd, const char *name);
38 virtual ~jit_avx512_core_resampling_kernel_base_t() = default;
39
40protected:
41 const resampling_pd_t *pd_;
42
43 data_type_t src_data_type() const;
44 data_type_t dst_data_type() const;
45};
46
47struct jit_avx512_core_resampling_bwd_t : public primitive_t {
48 struct pd_t : public cpu_resampling_bwd_pd_t {
49 using cpu_resampling_bwd_pd_t::cpu_resampling_bwd_pd_t;
50
51 DECLARE_COMMON_PD_T(JIT_IMPL_NAME_HELPER("jit:", avx512_core, ""),
52 jit_avx512_core_resampling_bwd_t);
53
54 status_t init(engine_t *engine);
55 };
56
57 jit_avx512_core_resampling_bwd_t(const pd_t *apd) : primitive_t(apd) {}
58 ~jit_avx512_core_resampling_bwd_t();
59
60 status_t init(engine_t *engine) override;
61
62 status_t execute(const exec_ctx_t &ctx) const override;
63
64private:
65 const pd_t *pd() const { return (const pd_t *)primitive_t::pd().get(); }
66 std::unique_ptr<jit_avx512_core_resampling_kernel_base_t> kernel_;
67};
68
69} // namespace x64
70} // namespace cpu
71} // namespace impl
72} // namespace dnnl
73
74#endif
75