[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3OpenCL / ParallelPrimitives / kernels / FillKernelsCL.h
1 //this file is autogenerated using stringify.bat (premake --stringify) in the build folder of this project
2 static const char* fillKernelsCL =
3         "/*\n"
4         "Copyright (c) 2012 Advanced Micro Devices, Inc.  \n"
5         "This software is provided 'as-is', without any express or implied warranty.\n"
6         "In no event will the authors be held liable for any damages arising from the use of this software.\n"
7         "Permission is granted to anyone to use this software for any purpose, \n"
8         "including commercial applications, and to alter it and redistribute it freely, \n"
9         "subject to the following restrictions:\n"
10         "1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n"
11         "2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n"
12         "3. This notice may not be removed or altered from any source distribution.\n"
13         "*/\n"
14         "//Originally written by Takahiro Harada\n"
15         "#pragma OPENCL EXTENSION cl_amd_printf : enable\n"
16         "#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics : enable\n"
17         "typedef unsigned int u32;\n"
18         "#define GET_GROUP_IDX get_group_id(0)\n"
19         "#define GET_LOCAL_IDX get_local_id(0)\n"
20         "#define GET_GLOBAL_IDX get_global_id(0)\n"
21         "#define GET_GROUP_SIZE get_local_size(0)\n"
22         "#define GROUP_LDS_BARRIER barrier(CLK_LOCAL_MEM_FENCE)\n"
23         "#define GROUP_MEM_FENCE mem_fence(CLK_LOCAL_MEM_FENCE)\n"
24         "#define AtomInc(x) atom_inc(&(x))\n"
25         "#define AtomInc1(x, out) out = atom_inc(&(x))\n"
26         "#define make_uint4 (uint4)\n"
27         "#define make_uint2 (uint2)\n"
28         "#define make_int2 (int2)\n"
29         "typedef struct\n"
30         "{\n"
31         "       union\n"
32         "       {\n"
33         "               int4 m_data;\n"
34         "               uint4 m_unsignedData;\n"
35         "               float   m_floatData;\n"
36         "       };\n"
37         "       int m_offset;\n"
38         "       int m_n;\n"
39         "       int m_padding[2];\n"
40         "} ConstBuffer;\n"
41         "__kernel\n"
42         "__attribute__((reqd_work_group_size(64,1,1)))\n"
43         "void FillIntKernel(__global int* dstInt,                       int num_elements, int value, const int offset)\n"
44         "{\n"
45         "       int gIdx = GET_GLOBAL_IDX;\n"
46         "       if( gIdx < num_elements )\n"
47         "       {\n"
48         "               dstInt[ offset+gIdx ] = value;\n"
49         "       }\n"
50         "}\n"
51         "__kernel\n"
52         "__attribute__((reqd_work_group_size(64,1,1)))\n"
53         "void FillFloatKernel(__global float* dstFloat,         int num_elements, float value, const int offset)\n"
54         "{\n"
55         "       int gIdx = GET_GLOBAL_IDX;\n"
56         "       if( gIdx < num_elements )\n"
57         "       {\n"
58         "               dstFloat[ offset+gIdx ] = value;\n"
59         "       }\n"
60         "}\n"
61         "__kernel\n"
62         "__attribute__((reqd_work_group_size(64,1,1)))\n"
63         "void FillUnsignedIntKernel(__global unsigned int* dstInt, const int num, const unsigned int value, const int offset)\n"
64         "{\n"
65         "       int gIdx = GET_GLOBAL_IDX;\n"
66         "       if( gIdx < num )\n"
67         "       {\n"
68         "               dstInt[ offset+gIdx ] = value;\n"
69         "       }\n"
70         "}\n"
71         "__kernel\n"
72         "__attribute__((reqd_work_group_size(64,1,1)))\n"
73         "void FillInt2Kernel(__global int2* dstInt2,    const int num, const int2 value, const int offset)\n"
74         "{\n"
75         "       int gIdx = GET_GLOBAL_IDX;\n"
76         "       if( gIdx < num )\n"
77         "       {\n"
78         "               dstInt2[ gIdx + offset] = make_int2( value.x, value.y );\n"
79         "       }\n"
80         "}\n"
81         "__kernel\n"
82         "__attribute__((reqd_work_group_size(64,1,1)))\n"
83         "void FillInt4Kernel(__global int4* dstInt4,            const int num, const int4 value, const int offset)\n"
84         "{\n"
85         "       int gIdx = GET_GLOBAL_IDX;\n"
86         "       if( gIdx < num )\n"
87         "       {\n"
88         "               dstInt4[ offset+gIdx ] = value;\n"
89         "       }\n"
90         "}\n";