1 | namespace dnnl { |
2 | namespace impl { |
3 | namespace gpu { |
4 | namespace ocl { |
5 | const char *ref_deconv_backward_bias_kernel = R"==(/******************************************************************************* )==" "\n" |
6 | R"==(* Copyright 2019-2020 Intel Corporation )==" "\n" |
7 | R"==(* )==" "\n" |
8 | R"==(* Licensed under the Apache License, Version 2.0 (the "License"); )==" "\n" |
9 | R"==(* you may not use this file except in compliance with the License. )==" "\n" |
10 | R"==(* You may obtain a copy of the License at )==" "\n" |
11 | R"==(* )==" "\n" |
12 | R"==(* http: )==" "\n" |
13 | R"==(* )==" "\n" |
14 | R"==(* Unless required by applicable law or agreed to in writing, software )==" "\n" |
15 | R"==(* distributed under the License is distributed on an "AS IS" BASIS, )==" "\n" |
16 | R"==(* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. )==" "\n" |
17 | R"==(* See the License for the specific language governing permissions and )==" "\n" |
18 | R"==(* limitations under the License. )==" "\n" |
19 | R"==(*******************************************************************************/ )==" "\n" |
20 | R"==(#include "gpu/ocl/ocl_types.h" )==" "\n" |
21 | R"==(__kernel void ref_deconv_backward_bias( )==" "\n" |
22 | R"==(__global DST_DATA_T *diff_dst, __global BIA_DATA_T *diff_bias) { )==" "\n" |
23 | R"==(const int g = get_global_id(0) / OC; )==" "\n" |
24 | R"==(const int oc = get_global_id(0) % OC; )==" "\n" |
25 | R"==(ACC_DATA_T db = 0; )==" "\n" |
26 | R"==(for (int mb = 0; mb < MB; ++mb) )==" "\n" |
27 | R"==(for (int od = 0; od < OD; ++od) )==" "\n" |
28 | R"==(for (int oh = 0; oh < OH; ++oh) )==" "\n" |
29 | R"==(for (int ow = 0; ow < OW; ++ow) { )==" "\n" |
30 | R"==(uint diff_dst_off = DST_OFF(mb, g * OC + oc, od, oh, ow); )==" "\n" |
31 | R"==(db += DST_TO_REF(diff_dst[diff_dst_off]); )==" "\n" |
32 | R"==(} )==" "\n" |
33 | R"==(diff_bias[g * OC + oc] = TO_BIA(db); )==" "\n" |
34 | R"==(} )==" "\n" |
35 | R"==()==" ; |
36 | } |
37 | } |
38 | } |
39 | } |