1 <!-- HTML header for doxygen 1.8.9.1-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <meta name="generator" content="Doxygen 1.8.11"/>
8 <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
9 <title>ARM Compute Library: src/core/CL/cl_kernels/gemm.cl File Reference</title>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="dynsections.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <script type="text/javascript">
18 $(document).ready(initResizable);
19 $(window).load(resizeHeight);
21 <link href="search/search.css" rel="stylesheet" type="text/css"/>
22 <script type="text/javascript" src="search/searchdata.js"></script>
23 <script type="text/javascript" src="search/search.js"></script>
24 <script type="text/javascript">
25 $(document).ready(function() { init_search(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
32 </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
33 <link href="doxygen.css" rel="stylesheet" type="text/css" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">ARM Compute Library
43  <span id="projectnumber">17.04</span>
50 <!-- end header part -->
51 <!-- Generated by Doxygen 1.8.11 -->
52 <script type="text/javascript">
53 var searchBox = new SearchBox("searchBox", "search",false,'Search');
55 <div id="navrow1" class="tabs">
57 <li><a href="index.xhtml"><span>Main Page</span></a></li>
58 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
59 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
60 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
62 <div id="MSearchBox" class="MSearchBoxInactive">
64 <img id="MSearchSelect" src="search/mag_sel.png"
65 onmouseover="return searchBox.OnSearchSelectShow()"
66 onmouseout="return searchBox.OnSearchSelectHide()"
68 <input type="text" id="MSearchField" value="Search" accesskey="S"
69 onfocus="searchBox.OnSearchFieldFocus(true)"
70 onblur="searchBox.OnSearchFieldFocus(false)"
71 onkeyup="searchBox.OnSearchFieldChange(event)"/>
72 </span><span class="right">
73 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
79 <div id="navrow2" class="tabs2">
81 <li><a href="files.xhtml"><span>File List</span></a></li>
82 <li><a href="globals.xhtml"><span>Globals</span></a></li>
86 <div id="side-nav" class="ui-resizable side-nav-resizable">
88 <div id="nav-tree-contents">
89 <div id="nav-sync" class="sync"></div>
92 <div id="splitbar" style="-moz-user-select:none;"
93 class="ui-resizable-handle">
96 <script type="text/javascript">
97 $(document).ready(function(){initNavTree('gemm_8cl.xhtml','');});
99 <div id="doc-content">
100 <!-- window showing the filter options -->
101 <div id="MSearchSelectWindow"
102 onmouseover="return searchBox.OnSearchSelectShow()"
103 onmouseout="return searchBox.OnSearchSelectHide()"
104 onkeydown="return searchBox.OnSearchSelectKey(event)">
107 <!-- iframe showing the search results (closed by default) -->
108 <div id="MSearchResultsWindow">
109 <iframe src="javascript:void(0)" frameborder="0"
110 name="MSearchResults" id="MSearchResults">
115 <div class="summary">
116 <a href="#func-members">Functions</a> </div>
117 <div class="headertitle">
118 <div class="title">gemm.cl File Reference</div> </div>
120 <div class="contents">
121 <div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br />
123 <p><a href="gemm_8cl_source.xhtml">Go to the source code of this file.</a></p>
124 <table class="memberdecls">
125 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
126 Functions</h2></td></tr>
127 <tr class="memitem:a21d7061f36aec78824e368f2ef1cafc1"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a21d7061f36aec78824e368f2ef1cafc1">gemm_transpose1x4_f32</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
128 <tr class="memdesc:a21d7061f36aec78824e368f2ef1cafc1"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel computes the "vector" 1x4 transposition of input matrix. <a href="#a21d7061f36aec78824e368f2ef1cafc1">More...</a><br /></td></tr>
129 <tr class="separator:a21d7061f36aec78824e368f2ef1cafc1"><td class="memSeparator" colspan="2"> </td></tr>
130 <tr class="memitem:a11d87ecaf1388b4f57404e062265b374"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a11d87ecaf1388b4f57404e062265b374">gemm_transpose1x8_f16</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
131 <tr class="memdesc:a11d87ecaf1388b4f57404e062265b374"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel computes the "vector" 1x8 transposition of input matrix. <a href="#a11d87ecaf1388b4f57404e062265b374">More...</a><br /></td></tr>
132 <tr class="separator:a11d87ecaf1388b4f57404e062265b374"><td class="memSeparator" colspan="2"> </td></tr>
133 <tr class="memitem:a675879eb72964ddbd5f71155da3b0cc3"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a675879eb72964ddbd5f71155da3b0cc3">gemm_transpose1x16_u8</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
134 <tr class="memdesc:a675879eb72964ddbd5f71155da3b0cc3"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel computes the "vector" 1x16 transposition of input matrix. <a href="#a675879eb72964ddbd5f71155da3b0cc3">More...</a><br /></td></tr>
135 <tr class="separator:a675879eb72964ddbd5f71155da3b0cc3"><td class="memSeparator" colspan="2"> </td></tr>
136 <tr class="memitem:acd423b6f992354e7c00137b20d687281"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#acd423b6f992354e7c00137b20d687281">gemm_interleave4x4_f32</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
137 <tr class="memdesc:acd423b6f992354e7c00137b20d687281"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. <a href="#acd423b6f992354e7c00137b20d687281">More...</a><br /></td></tr>
138 <tr class="separator:acd423b6f992354e7c00137b20d687281"><td class="memSeparator" colspan="2"> </td></tr>
139 <tr class="memitem:ae333c12d780666b2591f7c8e9faaf5a9"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#ae333c12d780666b2591f7c8e9faaf5a9">gemm_interleave4x4_f16</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
140 <tr class="memdesc:ae333c12d780666b2591f7c8e9faaf5a9"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. <a href="#ae333c12d780666b2591f7c8e9faaf5a9">More...</a><br /></td></tr>
141 <tr class="separator:ae333c12d780666b2591f7c8e9faaf5a9"><td class="memSeparator" colspan="2"> </td></tr>
142 <tr class="memitem:a830ba1cc0ad3c8cffa4a14424b2d0411"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a830ba1cc0ad3c8cffa4a14424b2d0411">gemm_interleave4x4_u8</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
143 <tr class="memdesc:a830ba1cc0ad3c8cffa4a14424b2d0411"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. <a href="#a830ba1cc0ad3c8cffa4a14424b2d0411">More...</a><br /></td></tr>
144 <tr class="separator:a830ba1cc0ad3c8cffa4a14424b2d0411"><td class="memSeparator" colspan="2"> </td></tr>
145 <tr class="memitem:a7c619984bc9c31f5f6c19ecc88b56581"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a7c619984bc9c31f5f6c19ecc88b56581">gemm_accumulate_biases_f32</a> (__global uchar *accum_ptr, uint accum_stride_x, uint accum_step_x, uint accum_stride_y, uint accum_step_y, uint accum_offset_first_element_in_bytes, __global uchar *biases_ptr, uint biases_stride_x, uint biases_step_x, uint biases_offset_first_element_in_bytes)</td></tr>
146 <tr class="memdesc:a7c619984bc9c31f5f6c19ecc88b56581"><td class="mdescLeft"> </td><td class="mdescRight">This kernel accumulates each row with the biases vector. <a href="#a7c619984bc9c31f5f6c19ecc88b56581">More...</a><br /></td></tr>
147 <tr class="separator:a7c619984bc9c31f5f6c19ecc88b56581"><td class="memSeparator" colspan="2"> </td></tr>
148 <tr class="memitem:a76295c333dfa3c9bb20975579dce87e8"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a76295c333dfa3c9bb20975579dce87e8">gemm_accumulate_biases_f16</a> (__global uchar *accum_ptr, uint accum_stride_x, uint accum_step_x, uint accum_stride_y, uint accum_step_y, uint accum_offset_first_element_in_bytes, __global uchar *biases_ptr, uint biases_stride_x, uint biases_step_x, uint biases_offset_first_element_in_bytes)</td></tr>
149 <tr class="memdesc:a76295c333dfa3c9bb20975579dce87e8"><td class="mdescLeft"> </td><td class="mdescRight">This kernel accumulates each row with the biases vector. <a href="#a76295c333dfa3c9bb20975579dce87e8">More...</a><br /></td></tr>
150 <tr class="separator:a76295c333dfa3c9bb20975579dce87e8"><td class="memSeparator" colspan="2"> </td></tr>
152 <h2 class="groupheader">Function Documentation</h2>
153 <a class="anchor" id="a76295c333dfa3c9bb20975579dce87e8"></a>
154 <div class="memitem">
155 <div class="memproto">
156 <table class="memname">
158 <td class="memname">__kernel void gemm_accumulate_biases_f16 </td>
160 <td class="paramtype">__global uchar * </td>
161 <td class="paramname"><em>accum_ptr</em>, </td>
164 <td class="paramkey"></td>
166 <td class="paramtype">uint </td>
167 <td class="paramname"><em>accum_stride_x</em>, </td>
170 <td class="paramkey"></td>
172 <td class="paramtype">uint </td>
173 <td class="paramname"><em>accum_step_x</em>, </td>
176 <td class="paramkey"></td>
178 <td class="paramtype">uint </td>
179 <td class="paramname"><em>accum_stride_y</em>, </td>
182 <td class="paramkey"></td>
184 <td class="paramtype">uint </td>
185 <td class="paramname"><em>accum_step_y</em>, </td>
188 <td class="paramkey"></td>
190 <td class="paramtype">uint </td>
191 <td class="paramname"><em>accum_offset_first_element_in_bytes</em>, </td>
194 <td class="paramkey"></td>
196 <td class="paramtype">__global uchar * </td>
197 <td class="paramname"><em>biases_ptr</em>, </td>
200 <td class="paramkey"></td>
202 <td class="paramtype">uint </td>
203 <td class="paramname"><em>biases_stride_x</em>, </td>
206 <td class="paramkey"></td>
208 <td class="paramtype">uint </td>
209 <td class="paramname"><em>biases_step_x</em>, </td>
212 <td class="paramkey"></td>
214 <td class="paramtype">uint </td>
215 <td class="paramname"><em>biases_offset_first_element_in_bytes</em> </td>
223 </div><div class="memdoc">
225 <p>This kernel accumulates each row with the biases vector. </p>
226 <dl class="params"><dt>Parameters</dt><dd>
227 <table class="params">
228 <tr><td class="paramdir">[in,out]</td><td class="paramname">accum_ptr</td><td>Pointer to the accumulate tensor. Supported data type: F16 </td></tr>
229 <tr><td class="paramdir">[in]</td><td class="paramname">accum_stride_x</td><td>Stride of the accumulate tensor in X dimension (in bytes) </td></tr>
230 <tr><td class="paramdir">[in]</td><td class="paramname">accum_step_x</td><td>accum_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
231 <tr><td class="paramdir">[in]</td><td class="paramname">accum_stride_y</td><td>Stride of the accumlulate tensor in Y dimension (in bytes) </td></tr>
232 <tr><td class="paramdir">[in]</td><td class="paramname">accum_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
233 <tr><td class="paramdir">[in]</td><td class="paramname">accum_offset_first_element_in_bytes</td><td>The offset of the first element in the accumulate tensor </td></tr>
234 <tr><td class="paramdir">[in]</td><td class="paramname">biases_ptr</td><td>Pointer to the biases vector. Same as input. </td></tr>
235 <tr><td class="paramdir">[in]</td><td class="paramname">biases_stride_x</td><td>Stride of the destination tensor in X dimension (in bytes) </td></tr>
236 <tr><td class="paramdir">[in]</td><td class="paramname">biases_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
237 <tr><td class="paramdir">[in]</td><td class="paramname">biases_offset_first_element_in_bytes</td><td>The offset of the first element in the destination tensor </td></tr>
242 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00290">290</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
244 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00067">CONVERT_TO_VECTOR_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00049">IMAGE_DECLARATION</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, <a class="el" href="helpers_8h_source.xhtml#l00089">Vector::ptr</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
245 <div class="fragment"><div class="line"><a name="l00293"></a><span class="lineno"> 293</span> {</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <a class="code" href="struct_image.xhtml">Image</a> accum = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(accum);</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <a class="code" href="struct_vector.xhtml">Vector</a> biases = <a class="code" href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a>(biases);</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> </div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  half8 accum_value = vload8(0, (__global half *)accum.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  half8 biases_value = vload8(0, (__global half *)biases.<a class="code" href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  accum_value = biases_value + accum_value;</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span> </div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="comment">// Store result in the accummulate buffer</span></div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  vstore8(accum_value, 0, (__global half *)accum.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span> }</div><div class="ttc" id="struct_vector_xhtml"><div class="ttname"><a href="struct_vector.xhtml">Vector</a></div><div class="ttdoc">Structure to hold Vector information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00087">helpers.h:87</a></div></div>
246 <div class="ttc" id="helpers_8h_xhtml_a527bfdf5eeb306f1cf01c4a8e29f38e0"><div class="ttname"><a href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_VECTOR_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00067">helpers.h:67</a></div></div>
247 <div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
248 <div class="ttc" id="struct_vector_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">Vector::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00089">helpers.h:89</a></div></div>
249 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
250 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00097">helpers.h:97</a></div></div>
251 </div><!-- fragment -->
254 <a class="anchor" id="a7c619984bc9c31f5f6c19ecc88b56581"></a>
255 <div class="memitem">
256 <div class="memproto">
257 <table class="memname">
259 <td class="memname">__kernel void gemm_accumulate_biases_f32 </td>
261 <td class="paramtype">__global uchar * </td>
262 <td class="paramname"><em>accum_ptr</em>, </td>
265 <td class="paramkey"></td>
267 <td class="paramtype">uint </td>
268 <td class="paramname"><em>accum_stride_x</em>, </td>
271 <td class="paramkey"></td>
273 <td class="paramtype">uint </td>
274 <td class="paramname"><em>accum_step_x</em>, </td>
277 <td class="paramkey"></td>
279 <td class="paramtype">uint </td>
280 <td class="paramname"><em>accum_stride_y</em>, </td>
283 <td class="paramkey"></td>
285 <td class="paramtype">uint </td>
286 <td class="paramname"><em>accum_step_y</em>, </td>
289 <td class="paramkey"></td>
291 <td class="paramtype">uint </td>
292 <td class="paramname"><em>accum_offset_first_element_in_bytes</em>, </td>
295 <td class="paramkey"></td>
297 <td class="paramtype">__global uchar * </td>
298 <td class="paramname"><em>biases_ptr</em>, </td>
301 <td class="paramkey"></td>
303 <td class="paramtype">uint </td>
304 <td class="paramname"><em>biases_stride_x</em>, </td>
307 <td class="paramkey"></td>
309 <td class="paramtype">uint </td>
310 <td class="paramname"><em>biases_step_x</em>, </td>
313 <td class="paramkey"></td>
315 <td class="paramtype">uint </td>
316 <td class="paramname"><em>biases_offset_first_element_in_bytes</em> </td>
324 </div><div class="memdoc">
326 <p>This kernel accumulates each row with the biases vector. </p>
327 <dl class="params"><dt>Parameters</dt><dd>
328 <table class="params">
329 <tr><td class="paramdir">[in,out]</td><td class="paramname">accum_ptr</td><td>Pointer to the accumulate tensor. Supported data type: F32 </td></tr>
330 <tr><td class="paramdir">[in]</td><td class="paramname">accum_stride_x</td><td>Stride of the accmulate tensor in X dimension (in bytes) </td></tr>
331 <tr><td class="paramdir">[in]</td><td class="paramname">accum_step_x</td><td>accum_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
332 <tr><td class="paramdir">[in]</td><td class="paramname">accum_stride_y</td><td>Stride of the accumlulate tensor in Y dimension (in bytes) </td></tr>
333 <tr><td class="paramdir">[in]</td><td class="paramname">accum_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
334 <tr><td class="paramdir">[in]</td><td class="paramname">accum_offset_first_element_in_bytes</td><td>The offset of the first element in the accumulate tensor </td></tr>
335 <tr><td class="paramdir">[in]</td><td class="paramname">biases_ptr</td><td>Pointer to the biases vector. Same as input. </td></tr>
336 <tr><td class="paramdir">[in]</td><td class="paramname">biases_stride_x</td><td>Stride of the destination tensor in X dimension (in bytes) </td></tr>
337 <tr><td class="paramdir">[in]</td><td class="paramname">biases_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
338 <tr><td class="paramdir">[in]</td><td class="paramname">biases_offset_first_element_in_bytes</td><td>The offset of the first element in the destination tensor </td></tr>
343 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00262">262</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
345 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00067">CONVERT_TO_VECTOR_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00089">Vector::ptr</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
346 <div class="fragment"><div class="line"><a name="l00265"></a><span class="lineno"> 265</span> {</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <a class="code" href="struct_image.xhtml">Image</a> accum = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(accum);</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <a class="code" href="struct_vector.xhtml">Vector</a> biases = <a class="code" href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a>(biases);</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span> </div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  float4 accum_value = vload4(0, (__global <span class="keywordtype">float</span> *)accum.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  float4 biases_value = vload4(0, (__global <span class="keywordtype">float</span> *)biases.<a class="code" href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  accum_value = biases_value + accum_value;</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> </div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="comment">// Store result in the accummulate buffer</span></div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  vstore4(accum_value, 0, (__global <span class="keywordtype">float</span> *)accum.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span> }</div><div class="ttc" id="struct_vector_xhtml"><div class="ttname"><a href="struct_vector.xhtml">Vector</a></div><div class="ttdoc">Structure to hold Vector information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00087">helpers.h:87</a></div></div>
347 <div class="ttc" id="helpers_8h_xhtml_a527bfdf5eeb306f1cf01c4a8e29f38e0"><div class="ttname"><a href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_VECTOR_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00067">helpers.h:67</a></div></div>
348 <div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
349 <div class="ttc" id="struct_vector_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">Vector::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00089">helpers.h:89</a></div></div>
350 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
351 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00097">helpers.h:97</a></div></div>
352 </div><!-- fragment -->
355 <a class="anchor" id="ae333c12d780666b2591f7c8e9faaf5a9"></a>
356 <div class="memitem">
357 <div class="memproto">
358 <table class="memname">
360 <td class="memname">__kernel void gemm_interleave4x4_f16 </td>
362 <td class="paramtype">__global uchar * </td>
363 <td class="paramname"><em>src_ptr</em>, </td>
366 <td class="paramkey"></td>
368 <td class="paramtype">uint </td>
369 <td class="paramname"><em>src_stride_x</em>, </td>
372 <td class="paramkey"></td>
374 <td class="paramtype">uint </td>
375 <td class="paramname"><em>src_step_x</em>, </td>
378 <td class="paramkey"></td>
380 <td class="paramtype">uint </td>
381 <td class="paramname"><em>src_stride_y</em>, </td>
384 <td class="paramkey"></td>
386 <td class="paramtype">uint </td>
387 <td class="paramname"><em>src_step_y</em>, </td>
390 <td class="paramkey"></td>
392 <td class="paramtype">uint </td>
393 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
396 <td class="paramkey"></td>
398 <td class="paramtype">__global uchar * </td>
399 <td class="paramname"><em>dst_ptr</em>, </td>
402 <td class="paramkey"></td>
404 <td class="paramtype">uint </td>
405 <td class="paramname"><em>dst_stride_x</em>, </td>
408 <td class="paramkey"></td>
410 <td class="paramtype">uint </td>
411 <td class="paramname"><em>dst_step_x</em>, </td>
414 <td class="paramkey"></td>
416 <td class="paramtype">uint </td>
417 <td class="paramname"><em>dst_stride_y</em>, </td>
420 <td class="paramkey"></td>
422 <td class="paramtype">uint </td>
423 <td class="paramname"><em>dst_step_y</em>, </td>
426 <td class="paramkey"></td>
428 <td class="paramtype">uint </td>
429 <td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
437 </div><div class="memdoc">
439 <p>This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. </p>
440 <dl class="params"><dt>Parameters</dt><dd>
441 <table class="params">
442 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: F16 </td></tr>
443 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source matrix in X dimension (in bytes) </td></tr>
444 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
445 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source matrix in Y dimension (in bytes) </td></tr>
446 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
447 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source matrix </td></tr>
448 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: F16 </td></tr>
449 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination matrix in X dimension (in bytes) </td></tr>
450 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
451 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination matrix in Y dimension (in bytes) </td></tr>
452 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
453 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination matrix </td></tr>
458 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00178">178</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
460 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
461 <div class="fragment"><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> {</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="comment">/* Compute source and destination addresses */</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <a class="code" href="struct_image.xhtml">Image</a> dst = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(dst);</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="comment">/* Load values from Matrix A */</span></div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  half8 a0 = vload8(0, (__global half *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 0)));</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  half8 a1 = vload8(0, (__global half *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 1)));</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  half8 a2 = vload8(0, (__global half *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 2)));</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  half8 a3 = vload8(0, (__global half *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 3)));</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> </div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  half8 val0 = (half8)((half4)(a0.s0, a1.s0, a2.s0, a3.s0), (half4)(a0.s1, a1.s1, a2.s1, a3.s1));</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  vstore8(val0, 0, ((__global half *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 0);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span> </div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  val0 = (half8)((half4)(a0.s2, a1.s2, a2.s2, a3.s2), (half4)(a0.s3, a1.s3, a2.s3, a3.s3));</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  vstore8(val0, 0, ((__global half *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 8);</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span> </div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  val0 = (half8)((half4)(a0.s4, a1.s4, a2.s4, a3.s4), (half4)(a0.s5, a1.s5, a2.s5, a3.s5));</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  vstore8(val0, 0, ((__global half *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 16);</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> </div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  val0 = (half8)((half4)(a0.s6, a1.s6, a2.s6, a3.s6), (half4)(a0.s7, a1.s7, a2.s7, a3.s7));</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  vstore8(val0, 0, ((__global half *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 24);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> }</div><div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00201">helpers.h:201</a></div></div>
462 <div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
463 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
464 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00097">helpers.h:97</a></div></div>
465 </div><!-- fragment -->
468 <a class="anchor" id="acd423b6f992354e7c00137b20d687281"></a>
469 <div class="memitem">
470 <div class="memproto">
471 <table class="memname">
473 <td class="memname">__kernel void gemm_interleave4x4_f32 </td>
475 <td class="paramtype">__global uchar * </td>
476 <td class="paramname"><em>src_ptr</em>, </td>
479 <td class="paramkey"></td>
481 <td class="paramtype">uint </td>
482 <td class="paramname"><em>src_stride_x</em>, </td>
485 <td class="paramkey"></td>
487 <td class="paramtype">uint </td>
488 <td class="paramname"><em>src_step_x</em>, </td>
491 <td class="paramkey"></td>
493 <td class="paramtype">uint </td>
494 <td class="paramname"><em>src_stride_y</em>, </td>
497 <td class="paramkey"></td>
499 <td class="paramtype">uint </td>
500 <td class="paramname"><em>src_step_y</em>, </td>
503 <td class="paramkey"></td>
505 <td class="paramtype">uint </td>
506 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
509 <td class="paramkey"></td>
511 <td class="paramtype">__global uchar * </td>
512 <td class="paramname"><em>dst_ptr</em>, </td>
515 <td class="paramkey"></td>
517 <td class="paramtype">uint </td>
518 <td class="paramname"><em>dst_stride_x</em>, </td>
521 <td class="paramkey"></td>
523 <td class="paramtype">uint </td>
524 <td class="paramname"><em>dst_step_x</em>, </td>
527 <td class="paramkey"></td>
529 <td class="paramtype">uint </td>
530 <td class="paramname"><em>dst_stride_y</em>, </td>
533 <td class="paramkey"></td>
535 <td class="paramtype">uint </td>
536 <td class="paramname"><em>dst_step_y</em>, </td>
539 <td class="paramkey"></td>
541 <td class="paramtype">uint </td>
542 <td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
550 </div><div class="memdoc">
552 <p>This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. </p>
553 <dl class="params"><dt>Parameters</dt><dd>
554 <table class="params">
555 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: F32 </td></tr>
556 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source matrix in X dimension (in bytes) </td></tr>
557 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
558 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source matrix in Y dimension (in bytes) </td></tr>
559 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
560 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source matrix </td></tr>
561 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: F32 </td></tr>
562 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination matrix in X dimension (in bytes) </td></tr>
563 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
564 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination matrix in Y dimension (in bytes) </td></tr>
565 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
566 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination matrix </td></tr>
571 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00137">137</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
573 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
574 <div class="fragment"><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="comment">/* Compute source and destination addresses */</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <a class="code" href="struct_image.xhtml">Image</a> dst = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(dst);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="comment">/* Load values from Matrix A */</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  float4 a0 = vload4(0, (__global <span class="keywordtype">float</span> *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 0)));</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  float4 a1 = vload4(0, (__global <span class="keywordtype">float</span> *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 1)));</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  float4 a2 = vload4(0, (__global <span class="keywordtype">float</span> *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 2)));</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  float4 a3 = vload4(0, (__global <span class="keywordtype">float</span> *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 3)));</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  float4 val0 = (float4)(a0.s0, a1.s0, a2.s0, a3.s0);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  vstore4(val0, 0, ((__global <span class="keywordtype">float</span> *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 0);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  val0 = (float4)(a0.s1, a1.s1, a2.s1, a3.s1);</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  vstore4(val0, 0, ((__global <span class="keywordtype">float</span> *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 4);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  val0 = (float4)(a0.s2, a1.s2, a2.s2, a3.s2);</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  vstore4(val0, 0, ((__global <span class="keywordtype">float</span> *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 8);</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  val0 = (float4)(a0.s3, a1.s3, a2.s3, a3.s3);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  vstore4(val0, 0, ((__global <span class="keywordtype">float</span> *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 12);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> }</div><div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00201">helpers.h:201</a></div></div>
575 <div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
576 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
577 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00097">helpers.h:97</a></div></div>
578 </div><!-- fragment -->
581 <a class="anchor" id="a830ba1cc0ad3c8cffa4a14424b2d0411"></a>
582 <div class="memitem">
583 <div class="memproto">
584 <table class="memname">
586 <td class="memname">__kernel void gemm_interleave4x4_u8 </td>
588 <td class="paramtype">__global uchar * </td>
589 <td class="paramname"><em>src_ptr</em>, </td>
592 <td class="paramkey"></td>
594 <td class="paramtype">uint </td>
595 <td class="paramname"><em>src_stride_x</em>, </td>
598 <td class="paramkey"></td>
600 <td class="paramtype">uint </td>
601 <td class="paramname"><em>src_step_x</em>, </td>
604 <td class="paramkey"></td>
606 <td class="paramtype">uint </td>
607 <td class="paramname"><em>src_stride_y</em>, </td>
610 <td class="paramkey"></td>
612 <td class="paramtype">uint </td>
613 <td class="paramname"><em>src_step_y</em>, </td>
616 <td class="paramkey"></td>
618 <td class="paramtype">uint </td>
619 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
622 <td class="paramkey"></td>
624 <td class="paramtype">__global uchar * </td>
625 <td class="paramname"><em>dst_ptr</em>, </td>
628 <td class="paramkey"></td>
630 <td class="paramtype">uint </td>
631 <td class="paramname"><em>dst_stride_x</em>, </td>
634 <td class="paramkey"></td>
636 <td class="paramtype">uint </td>
637 <td class="paramname"><em>dst_step_x</em>, </td>
640 <td class="paramkey"></td>
642 <td class="paramtype">uint </td>
643 <td class="paramname"><em>dst_stride_y</em>, </td>
646 <td class="paramkey"></td>
648 <td class="paramtype">uint </td>
649 <td class="paramname"><em>dst_step_y</em>, </td>
652 <td class="paramkey"></td>
654 <td class="paramtype">uint </td>
655 <td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
663 </div><div class="memdoc">
665 <p>This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. </p>
666 <dl class="params"><dt>Parameters</dt><dd>
667 <table class="params">
668 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U8 </td></tr>
669 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source matrix in X dimension (in bytes) </td></tr>
670 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
671 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source matrix in Y dimension (in bytes) </td></tr>
672 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
673 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source matrix </td></tr>
674 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: U8 </td></tr>
675 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination matrix in X dimension (in bytes) </td></tr>
676 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
677 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination matrix in Y dimension (in bytes) </td></tr>
678 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
679 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination matrix </td></tr>
684 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00219">219</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
686 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
687 <div class="fragment"><div class="line"><a name="l00221"></a><span class="lineno"> 221</span> {</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="comment">/* Compute source and destination addresses */</span></div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <a class="code" href="struct_image.xhtml">Image</a> dst = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(dst);</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> </div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="comment">/* Load values from Matrix A */</span></div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  uchar16 a0 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 0)));</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  uchar16 a1 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 1)));</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  uchar16 a2 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 2)));</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  uchar16 a3 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 3)));</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  uchar16 val0 = (uchar16)((uchar4)(a0.s0, a1.s0, a2.s0, a3.s0), (uchar4)(a0.s1, a1.s1, a2.s1, a3.s1),</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  (uchar4)(a0.s2, a1.s2, a2.s2, a3.s2), (uchar4)(a0.s3, a1.s3, a2.s3, a3.s3));</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 0);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> </div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  val0 = (uchar16)((uchar4)(a0.s4, a1.s4, a2.s4, a3.s4), (uchar4)(a0.s5, a1.s5, a2.s5, a3.s5),</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  (uchar4)(a0.s6, a1.s6, a2.s6, a3.s6), (uchar4)(a0.s7, a1.s7, a2.s7, a3.s7));</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 16);</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> </div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  val0 = (uchar16)((uchar4)(a0.s8, a1.s8, a2.s8, a3.s8), (uchar4)(a0.s9, a1.s9, a2.s9, a3.s9),</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  (uchar4)(a0.sA, a1.sA, a2.sA, a3.sA), (uchar4)(a0.sB, a1.sB, a2.sB, a3.sB));</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 32);</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span> </div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  val0 = (uchar16)((uchar4)(a0.sC, a1.sC, a2.sC, a3.sC), (uchar4)(a0.sD, a1.sD, a2.sD, a3.sD),</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  (uchar4)(a0.sE, a1.sE, a2.sE, a3.sE), (uchar4)(a0.sF, a1.sF, a2.sF, a3.sF));</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 48);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> }</div><div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00201">helpers.h:201</a></div></div>
688 <div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
689 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
690 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00097">helpers.h:97</a></div></div>
691 </div><!-- fragment -->
694 <a class="anchor" id="a675879eb72964ddbd5f71155da3b0cc3"></a>
695 <div class="memitem">
696 <div class="memproto">
697 <table class="memname">
699 <td class="memname">__kernel void gemm_transpose1x16_u8 </td>
701 <td class="paramtype">__global uchar * </td>
702 <td class="paramname"><em>src_ptr</em>, </td>
705 <td class="paramkey"></td>
707 <td class="paramtype">uint </td>
708 <td class="paramname"><em>src_stride_x</em>, </td>
711 <td class="paramkey"></td>
713 <td class="paramtype">uint </td>
714 <td class="paramname"><em>src_step_x</em>, </td>
717 <td class="paramkey"></td>
719 <td class="paramtype">uint </td>
720 <td class="paramname"><em>src_stride_y</em>, </td>
723 <td class="paramkey"></td>
725 <td class="paramtype">uint </td>
726 <td class="paramname"><em>src_step_y</em>, </td>
729 <td class="paramkey"></td>
731 <td class="paramtype">uint </td>
732 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
735 <td class="paramkey"></td>
737 <td class="paramtype">__global uchar * </td>
738 <td class="paramname"><em>dst_ptr</em>, </td>
741 <td class="paramkey"></td>
743 <td class="paramtype">uint </td>
744 <td class="paramname"><em>dst_stride_x</em>, </td>
747 <td class="paramkey"></td>
749 <td class="paramtype">uint </td>
750 <td class="paramname"><em>dst_step_x</em>, </td>
753 <td class="paramkey"></td>
755 <td class="paramtype">uint </td>
756 <td class="paramname"><em>dst_stride_y</em>, </td>
759 <td class="paramkey"></td>
761 <td class="paramtype">uint </td>
762 <td class="paramname"><em>dst_step_y</em>, </td>
765 <td class="paramkey"></td>
767 <td class="paramtype">uint </td>
768 <td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
776 </div><div class="memdoc">
778 <p>This OpenCL kernel computes the "vector" 1x16 transposition of input matrix. </p>
779 <dl class="params"><dt>Parameters</dt><dd>
780 <table class="params">
781 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U8 </td></tr>
782 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source matrix in X dimension (in bytes) </td></tr>
783 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
784 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source matrix in Y dimension (in bytes) </td></tr>
785 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
786 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source matrix </td></tr>
787 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: U8 </td></tr>
788 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination matrix in X dimension (in bytes) </td></tr>
789 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
790 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination matrix in Y dimension (in bytes) </td></tr>
791 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
792 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination matrix </td></tr>
797 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00105">105</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
799 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
800 <div class="fragment"><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  uint x = get_global_id(0);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  uint y = get_global_id(1);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="comment">/* Compute address for Matrix B - source */</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> </div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">/* Compute address for Matrix B transposed - destination. X and Y are swapped */</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  uint dst_addr_in_bytes = y * 16 + ((x * dst_stride_y + dst_offset_first_element_in_bytes));</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  uchar16 b0 = vload16(0, (__global uchar *)src.ptr);</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  vstore16(b0, 0, (__global uchar *)(dst_ptr + dst_addr_in_bytes));</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> }</div><div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
801 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
802 </div><!-- fragment -->
805 <a class="anchor" id="a21d7061f36aec78824e368f2ef1cafc1"></a>
806 <div class="memitem">
807 <div class="memproto">
808 <table class="memname">
810 <td class="memname">__kernel void gemm_transpose1x4_f32 </td>
812 <td class="paramtype">__global uchar * </td>
813 <td class="paramname"><em>src_ptr</em>, </td>
816 <td class="paramkey"></td>
818 <td class="paramtype">uint </td>
819 <td class="paramname"><em>src_stride_x</em>, </td>
822 <td class="paramkey"></td>
824 <td class="paramtype">uint </td>
825 <td class="paramname"><em>src_step_x</em>, </td>
828 <td class="paramkey"></td>
830 <td class="paramtype">uint </td>
831 <td class="paramname"><em>src_stride_y</em>, </td>
834 <td class="paramkey"></td>
836 <td class="paramtype">uint </td>
837 <td class="paramname"><em>src_step_y</em>, </td>
840 <td class="paramkey"></td>
842 <td class="paramtype">uint </td>
843 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
846 <td class="paramkey"></td>
848 <td class="paramtype">__global uchar * </td>
849 <td class="paramname"><em>dst_ptr</em>, </td>
852 <td class="paramkey"></td>
854 <td class="paramtype">uint </td>
855 <td class="paramname"><em>dst_stride_x</em>, </td>
858 <td class="paramkey"></td>
860 <td class="paramtype">uint </td>
861 <td class="paramname"><em>dst_step_x</em>, </td>
864 <td class="paramkey"></td>
866 <td class="paramtype">uint </td>
867 <td class="paramname"><em>dst_stride_y</em>, </td>
870 <td class="paramkey"></td>
872 <td class="paramtype">uint </td>
873 <td class="paramname"><em>dst_step_y</em>, </td>
876 <td class="paramkey"></td>
878 <td class="paramtype">uint </td>
879 <td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
887 </div><div class="memdoc">
889 <p>This OpenCL kernel computes the "vector" 1x4 transposition of input matrix. </p>
890 <dl class="params"><dt>Parameters</dt><dd>
891 <table class="params">
892 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: F32 </td></tr>
893 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source matrix in X dimension (in bytes) </td></tr>
894 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
895 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source matrix in Y dimension (in bytes) </td></tr>
896 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
897 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source matrix </td></tr>
898 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: F32 </td></tr>
899 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination matrix in X dimension (in bytes) </td></tr>
900 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
901 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination matrix in Y dimension (in bytes) </td></tr>
902 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
903 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination matrix </td></tr>
908 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00041">41</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
910 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
911 <div class="fragment"><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> {</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  uint x = get_global_id(0);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  uint y = get_global_id(1);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="comment">/* Compute address for Matrix B - source */</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">/* Compute address for Matrix B transposed - destination. X and Y are swapped */</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  uint dst_addr_in_bytes = y * 16 + ((x * dst_stride_y + dst_offset_first_element_in_bytes));</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  float4 b0 = vload4(0, (__global <span class="keywordtype">float</span> *)src.ptr);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  vstore4(b0, 0, (__global <span class="keywordtype">float</span> *)(dst_ptr + dst_addr_in_bytes));</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
912 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
913 </div><!-- fragment -->
916 <a class="anchor" id="a11d87ecaf1388b4f57404e062265b374"></a>
917 <div class="memitem">
918 <div class="memproto">
919 <table class="memname">
921 <td class="memname">__kernel void gemm_transpose1x8_f16 </td>
923 <td class="paramtype">__global uchar * </td>
924 <td class="paramname"><em>src_ptr</em>, </td>
927 <td class="paramkey"></td>
929 <td class="paramtype">uint </td>
930 <td class="paramname"><em>src_stride_x</em>, </td>
933 <td class="paramkey"></td>
935 <td class="paramtype">uint </td>
936 <td class="paramname"><em>src_step_x</em>, </td>
939 <td class="paramkey"></td>
941 <td class="paramtype">uint </td>
942 <td class="paramname"><em>src_stride_y</em>, </td>
945 <td class="paramkey"></td>
947 <td class="paramtype">uint </td>
948 <td class="paramname"><em>src_step_y</em>, </td>
951 <td class="paramkey"></td>
953 <td class="paramtype">uint </td>
954 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
957 <td class="paramkey"></td>
959 <td class="paramtype">__global uchar * </td>
960 <td class="paramname"><em>dst_ptr</em>, </td>
963 <td class="paramkey"></td>
965 <td class="paramtype">uint </td>
966 <td class="paramname"><em>dst_stride_x</em>, </td>
969 <td class="paramkey"></td>
971 <td class="paramtype">uint </td>
972 <td class="paramname"><em>dst_step_x</em>, </td>
975 <td class="paramkey"></td>
977 <td class="paramtype">uint </td>
978 <td class="paramname"><em>dst_stride_y</em>, </td>
981 <td class="paramkey"></td>
983 <td class="paramtype">uint </td>
984 <td class="paramname"><em>dst_step_y</em>, </td>
987 <td class="paramkey"></td>
989 <td class="paramtype">uint </td>
990 <td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
998 </div><div class="memdoc">
1000 <p>This OpenCL kernel computes the "vector" 1x8 transposition of input matrix. </p>
1001 <dl class="params"><dt>Parameters</dt><dd>
1002 <table class="params">
1003 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: F16 </td></tr>
1004 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source matrix in X dimension (in bytes) </td></tr>
1005 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
1006 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source matrix in Y dimension (in bytes) </td></tr>
1007 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
1008 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source matrix </td></tr>
1009 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: F16 </td></tr>
1010 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination matrix in X dimension (in bytes) </td></tr>
1011 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
1012 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination matrix in Y dimension (in bytes) </td></tr>
1013 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
1014 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination matrix </td></tr>
1019 <p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00073">73</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
1021 <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
1022 <div class="fragment"><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  uint x = get_global_id(0);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  uint y = get_global_id(1);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="comment">/* Compute address for Matrix B - source */</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="comment">/* Compute address for Matrix B transposed - destination. X and Y are swapped */</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  uint dst_addr_in_bytes = y * 16 + ((x * dst_stride_y + dst_offset_first_element_in_bytes));</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  half8 b0 = vload8(0, (__global half *)src.ptr);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  vstore8(b0, 0, (__global half *)(dst_ptr + dst_addr_in_bytes));</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> }</div><div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
1023 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
1024 </div><!-- fragment -->
1027 </div><!-- contents -->
1028 </div><!-- doc-content -->
1029 <!-- start footer part -->
1030 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
1032 <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_8c278f79c760e5c5fbd911f9870614c1.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_25885286e9dad4fa105b7b25a8031bbf.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="gemm_8cl.xhtml">gemm.cl</a></li>
1033 <li class="footer">Generated on Wed Apr 12 2017 14:26:05 for ARM Compute Library by
1034 <a href="http://www.doxygen.org/index.html">
1035 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>