1 | namespace dnnl { |
2 | namespace impl { |
3 | namespace gpu { |
4 | namespace ocl { |
5 | const char *simple_sum_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"==(__kernel void simple_sum( )==" "\n" |
21 | R"==(__global float *input, __global float *output, float scale, int a) { )==" "\n" |
22 | R"==(const int c = get_global_id(0); )==" "\n" |
23 | R"==(if (a == 0) )==" "\n" |
24 | R"==(output[c] = (scale * input[c]); )==" "\n" |
25 | R"==(else )==" "\n" |
26 | R"==(output[c] += (scale * input[c]); )==" "\n" |
27 | R"==(} )==" "\n" |
28 | R"==()==" ; |
29 | } |
30 | } |
31 | } |
32 | } |