1 | /******************************************************************************* |
2 | * Copyright 2021 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 <utility> |
18 | |
19 | #include "cpu/x64/ip_convolution.hpp" |
20 | |
21 | namespace dnnl { |
22 | namespace impl { |
23 | namespace cpu { |
24 | namespace x64 { |
25 | |
26 | status_t ip_convolution_fwd_t::execute(const exec_ctx_t &ctx) const { |
27 | using namespace memory_tracking::names; |
28 | |
29 | exec_args_t ip_args = ctx.args(); |
30 | |
31 | exec_ctx_t conv_ctx(ctx, std::move(ip_args)); |
32 | |
33 | nested_scratchpad_t ns(ctx, key_nested, ip_p_); |
34 | conv_ctx.set_scratchpad_grantor(ns.grantor()); |
35 | |
36 | return ip_p_->execute(conv_ctx); |
37 | } |
38 | |
39 | status_t ip_convolution_bwd_data_t::execute(const exec_ctx_t &ctx) const { |
40 | using namespace memory_tracking::names; |
41 | |
42 | exec_args_t ip_args = ctx.args(); |
43 | |
44 | exec_ctx_t conv_ctx(ctx, std::move(ip_args)); |
45 | |
46 | nested_scratchpad_t ns(ctx, key_nested, ip_p_); |
47 | conv_ctx.set_scratchpad_grantor(ns.grantor()); |
48 | |
49 | return ip_p_->execute(conv_ctx); |
50 | } |
51 | |
52 | status_t ip_convolution_bwd_weights_t::execute(const exec_ctx_t &ctx) const { |
53 | using namespace memory_tracking::names; |
54 | |
55 | exec_args_t ip_args = ctx.args(); |
56 | |
57 | exec_ctx_t conv_ctx(ctx, std::move(ip_args)); |
58 | |
59 | nested_scratchpad_t ns(ctx, key_nested, ip_p_); |
60 | conv_ctx.set_scratchpad_grantor(ns.grantor()); |
61 | |
62 | return ip_p_->execute(conv_ctx); |
63 | } |
64 | |
65 | } // namespace x64 |
66 | } // namespace cpu |
67 | } // namespace impl |
68 | } // namespace dnnl |
69 | |
70 | // vim: et ts=4 sw=4 cindent cino+=l0,\:4,N-s |
71 | |