1namespace dnnl {
2namespace impl {
3namespace gpu {
4namespace ocl {
5const char *xe_lp_gemm_nocopy_scale_x8x8s32_kernel = R"==(/******************************************************************************* )==""\n"
6R"==(* Copyright 2019-2022 Intel Corporation )==""\n"
7R"==(* )==""\n"
8R"==(* Licensed under the Apache License, Version 2.0 (the "License"); )==""\n"
9R"==(* you may not use this file except in compliance with the License. )==""\n"
10R"==(* You may obtain a copy of the License at )==""\n"
11R"==(* )==""\n"
12R"==(* http: )==""\n"
13R"==(* )==""\n"
14R"==(* Unless required by applicable law or agreed to in writing, software )==""\n"
15R"==(* distributed under the License is distributed on an "AS IS" BASIS, )==""\n"
16R"==(* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. )==""\n"
17R"==(* See the License for the specific language governing permissions and )==""\n"
18R"==(* limitations under the License. )==""\n"
19R"==(*******************************************************************************/ )==""\n"
20R"==(#include "gpu/ocl/gemm/ocl_gemm_attrs.h" )==""\n"
21R"==(#include "gpu/ocl/ocl_post_ops.h" )==""\n"
22R"==(#include "gpu/ocl/ocl_types.h" )==""\n"
23R"==(#if WITH_ELTWISE == 1 )==""\n"
24R"==(#define POST_OP(val) \ )==""\n"
25R"==(do { \ )==""\n"
26R"==(if (apply_eltwise) \ )==""\n"
27R"==(val = fwd_eltwise( \ )==""\n"
28R"==(val, eltwise_alpha, eltwise_beta, eltwise_scale); \ )==""\n"
29R"==(} while (0) )==""\n"
30R"==(#else )==""\n"
31R"==(#define POST_OP(val) )==""\n"
32R"==(#endif )==""\n"
33R"==(kernel void xe_lp_gemm_scale_x8x8s32(global int *cc, global int *c, char trc, )==""\n"
34R"==(int offset_c, int m, int n, int ldc, global float *alpha, float beta, )==""\n"
35R"==(global int *co, int offset_co, int alpha_is_zero, int apply_eltwise, )==""\n"
36R"==(float eltwise_alpha, float eltwise_beta, float eltwise_scale) { )==""\n"
37R"==(int idx = get_group_id(0); )==""\n"
38R"==(int idy = get_group_id(1); )==""\n"
39R"==(int lid = get_local_id(0); )==""\n"
40R"==(int j; )==""\n"
41R"==(int offset_cc = 0; )==""\n"
42R"==(int offset_x = 0; )==""\n"
43R"==(int ldcc = m; )==""\n"
44R"==(m -= 32 * idx; )==""\n"
45R"==(if (m > 32) m = 32; )==""\n"
46R"==(n -= 16 * idy; )==""\n"
47R"==(if (n > 16) n = 16; )==""\n"
48R"==(m -= 32 * lid / 16; )==""\n"
49R"==(if ((m <= 0) || (n <= 0)) return; )==""\n"
50R"==(offset_cc = 32 * idx + 32 * lid / 16 + 16 * idy * ldcc; )==""\n"
51R"==(offset_c += 32 * idx + 32 * lid / 16 + 16 * idy * ldc; )==""\n"
52R"==(if (trc == 'C') offset_co += 32 * idx + 32 * lid / 16; )==""\n"
53R"==(if (trc == 'R') offset_co += 16 * idy; )==""\n"
54R"==(for (j = 0; j < n; j++) { )==""\n"
55R"==(if (m > 0) { )==""\n"
56R"==(float val = (alpha_is_zero ? 0 : ATTR_ALPHA) * cc[offset_cc + 0] )==""\n"
57R"==(+ beta * c[offset_c + 0]; )==""\n"
58R"==(POST_OP(val); )==""\n"
59R"==(c[offset_c] = convert_int_sat_rte( )==""\n"
60R"==(val + (co ? co[offset_co + offset_x] : 0)); )==""\n"
61R"==(if (trc == 'C') { offset_x++; } )==""\n"
62R"==(} )==""\n"
63R"==(if (m > 1) { )==""\n"
64R"==(float val = (alpha_is_zero ? 0 : ATTR_ALPHA) * cc[offset_cc + 1] )==""\n"
65R"==(+ beta * c[offset_c + 1]; )==""\n"
66R"==(POST_OP(val); )==""\n"
67R"==(c[offset_c + 1] = convert_int_sat_rte( )==""\n"
68R"==(val + (co ? co[offset_co + offset_x] : 0)); )==""\n"
69R"==(} )==""\n"
70R"==(offset_cc += ldcc; )==""\n"
71R"==(offset_c += ldc; )==""\n"
72R"==(if (trc == 'C') offset_x = 0; )==""\n"
73R"==(if (trc == 'R') offset_x++; )==""\n"
74R"==(} )==""\n"
75R"==(} )==""\n"
76R"==()==";
77}
78}
79}
80}