blob: e492fd340312d05b1c5acc7b7e06e9bfbad7e815 [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001<!-- 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">
4<head>
5<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6<meta http-equiv="X-UA-Compatible" content="IE=9"/>
Kaizen8938bd32017-09-28 14:38:23 +01007<meta name="generator" content="Doxygen 1.8.6"/>
Anthony Barbier871448e2017-03-24 14:54:29 +00008<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
Anthony Barbierdbdab852017-06-23 15:42:00 +01009<title>Compute Library: src/core/CL/cl_kernels/gemm.cl File Reference</title>
Anthony Barbier871448e2017-03-24 14:54:29 +000010<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>
Anthony Barbier871448e2017-03-24 14:54:29 +000015<script type="text/javascript" src="navtree.js"></script>
16<script type="text/javascript">
17 $(document).ready(initResizable);
18 $(window).load(resizeHeight);
19</script>
20<link href="search/search.css" rel="stylesheet" type="text/css"/>
Anthony Barbier871448e2017-03-24 14:54:29 +000021<script type="text/javascript" src="search/search.js"></script>
22<script type="text/javascript">
Kaizen8938bd32017-09-28 14:38:23 +010023 $(document).ready(function() { searchBox.OnSelectItem(0); });
Anthony Barbier871448e2017-03-24 14:54:29 +000024</script>
25<script type="text/x-mathjax-config">
26 MathJax.Hub.Config({
27 extensions: ["tex2jax.js"],
28 jax: ["input/TeX","output/HTML-CSS"],
29});
Kaizen8938bd32017-09-28 14:38:23 +010030</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000031<link href="doxygen.css" rel="stylesheet" type="text/css" />
32</head>
33<body>
34<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
35<div id="titlearea">
36<table cellspacing="0" cellpadding="0">
37 <tbody>
38 <tr style="height: 56px;">
39 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010040 <div id="projectname">Compute Library
Kaizen8938bd32017-09-28 14:38:23 +010041 &#160;<span id="projectnumber">17.09</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000042 </div>
43 </td>
44 </tr>
45 </tbody>
46</table>
47</div>
48<!-- end header part -->
Kaizen8938bd32017-09-28 14:38:23 +010049<!-- Generated by Doxygen 1.8.6 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000050<script type="text/javascript">
51var searchBox = new SearchBox("searchBox", "search",false,'Search');
52</script>
53 <div id="navrow1" class="tabs">
54 <ul class="tablist">
55 <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010056 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000057 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
58 <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
59 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
60 <li>
61 <div id="MSearchBox" class="MSearchBoxInactive">
62 <span class="left">
63 <img id="MSearchSelect" src="search/mag_sel.png"
64 onmouseover="return searchBox.OnSearchSelectShow()"
65 onmouseout="return searchBox.OnSearchSelectHide()"
66 alt=""/>
67 <input type="text" id="MSearchField" value="Search" accesskey="S"
68 onfocus="searchBox.OnSearchFieldFocus(true)"
69 onblur="searchBox.OnSearchFieldFocus(false)"
70 onkeyup="searchBox.OnSearchFieldChange(event)"/>
71 </span><span class="right">
72 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
73 </span>
74 </div>
75 </li>
76 </ul>
77 </div>
78 <div id="navrow2" class="tabs2">
79 <ul class="tablist">
80 <li><a href="files.xhtml"><span>File&#160;List</span></a></li>
81 <li><a href="globals.xhtml"><span>Globals</span></a></li>
82 </ul>
83 </div>
84</div><!-- top -->
85<div id="side-nav" class="ui-resizable side-nav-resizable">
86 <div id="nav-tree">
87 <div id="nav-tree-contents">
88 <div id="nav-sync" class="sync"></div>
89 </div>
90 </div>
91 <div id="splitbar" style="-moz-user-select:none;"
92 class="ui-resizable-handle">
93 </div>
94</div>
95<script type="text/javascript">
96$(document).ready(function(){initNavTree('gemm_8cl.xhtml','');});
97</script>
98<div id="doc-content">
99<!-- window showing the filter options -->
100<div id="MSearchSelectWindow"
101 onmouseover="return searchBox.OnSearchSelectShow()"
102 onmouseout="return searchBox.OnSearchSelectHide()"
103 onkeydown="return searchBox.OnSearchSelectKey(event)">
Kaizen8938bd32017-09-28 14:38:23 +0100104<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000105
106<!-- iframe showing the search results (closed by default) -->
107<div id="MSearchResultsWindow">
108<iframe src="javascript:void(0)" frameborder="0"
109 name="MSearchResults" id="MSearchResults">
110</iframe>
111</div>
112
113<div class="header">
114 <div class="summary">
115<a href="#func-members">Functions</a> </div>
116 <div class="headertitle">
117<div class="title">gemm.cl File Reference</div> </div>
118</div><!--header-->
119<div class="contents">
Kaizen8938bd32017-09-28 14:38:23 +0100120<div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br/>
Anthony Barbier871448e2017-03-24 14:54:29 +0000121</div>
122<p><a href="gemm_8cl_source.xhtml">Go to the source code of this file.</a></p>
123<table class="memberdecls">
124<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
125Functions</h2></td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100126<tr class="memitem:ac5eba21b9ac015e1454044aeba93546c"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#ac5eba21b9ac015e1454044aeba93546c">gemm_transpose1x4</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>
127<tr class="memdesc:ac5eba21b9ac015e1454044aeba93546c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This OpenCL kernel computes the "vector" 1x4 transposition of input matrix. <a href="#ac5eba21b9ac015e1454044aeba93546c">More...</a><br/></td></tr>
128<tr class="separator:ac5eba21b9ac015e1454044aeba93546c"><td class="memSeparator" colspan="2">&#160;</td></tr>
129<tr class="memitem:a75c35ac120f123e9cce56c43ba3f48d2"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a75c35ac120f123e9cce56c43ba3f48d2">gemm_transpose1x8</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>
130<tr class="memdesc:a75c35ac120f123e9cce56c43ba3f48d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This OpenCL kernel computes the "vector" 1x8 transposition of input matrix. <a href="#a75c35ac120f123e9cce56c43ba3f48d2">More...</a><br/></td></tr>
131<tr class="separator:a75c35ac120f123e9cce56c43ba3f48d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
132<tr class="memitem:a97a299ffb620aa98fe5e39bb8ab0833f"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a97a299ffb620aa98fe5e39bb8ab0833f">gemm_transpose1x16</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>
133<tr class="memdesc:a97a299ffb620aa98fe5e39bb8ab0833f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This OpenCL kernel computes the "vector" 1x16 transposition of input matrix. <a href="#a97a299ffb620aa98fe5e39bb8ab0833f">More...</a><br/></td></tr>
134<tr class="separator:a97a299ffb620aa98fe5e39bb8ab0833f"><td class="memSeparator" colspan="2">&#160;</td></tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100135<tr class="memitem:a560b2d50aa886edc0f5daf4fe729717f"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a560b2d50aa886edc0f5daf4fe729717f">gemm_interleave4x4_32bit</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>
Kaizen8938bd32017-09-28 14:38:23 +0100136<tr class="memdesc:a560b2d50aa886edc0f5daf4fe729717f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. <a href="#a560b2d50aa886edc0f5daf4fe729717f">More...</a><br/></td></tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100137<tr class="separator:a560b2d50aa886edc0f5daf4fe729717f"><td class="memSeparator" colspan="2">&#160;</td></tr>
138<tr class="memitem:a2f32d740e780059f68da8aa589ed0a5b"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#a2f32d740e780059f68da8aa589ed0a5b">gemm_interleave4x4_16bit</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>
Kaizen8938bd32017-09-28 14:38:23 +0100139<tr class="memdesc:a2f32d740e780059f68da8aa589ed0a5b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. <a href="#a2f32d740e780059f68da8aa589ed0a5b">More...</a><br/></td></tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100140<tr class="separator:a2f32d740e780059f68da8aa589ed0a5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
141<tr class="memitem:aa66a7b6b0420e54ec173743e6c5bfc45"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gemm_8cl.xhtml#aa66a7b6b0420e54ec173743e6c5bfc45">gemm_interleave4x4_8bit</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>
Kaizen8938bd32017-09-28 14:38:23 +0100142<tr class="memdesc:aa66a7b6b0420e54ec173743e6c5bfc45"><td class="mdescLeft">&#160;</td><td class="mdescRight">This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. <a href="#aa66a7b6b0420e54ec173743e6c5bfc45">More...</a><br/></td></tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100143<tr class="separator:aa66a7b6b0420e54ec173743e6c5bfc45"><td class="memSeparator" colspan="2">&#160;</td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000144</table>
145<h2 class="groupheader">Function Documentation</h2>
Anthony Barbier46d59272017-05-04 09:15:15 +0100146<a class="anchor" id="a2f32d740e780059f68da8aa589ed0a5b"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000147<div class="memitem">
148<div class="memproto">
149 <table class="memname">
150 <tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100151 <td class="memname">__kernel void gemm_interleave4x4_16bit </td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000152 <td>(</td>
153 <td class="paramtype">__global uchar *&#160;</td>
154 <td class="paramname"><em>src_ptr</em>, </td>
155 </tr>
156 <tr>
157 <td class="paramkey"></td>
158 <td></td>
159 <td class="paramtype">uint&#160;</td>
160 <td class="paramname"><em>src_stride_x</em>, </td>
161 </tr>
162 <tr>
163 <td class="paramkey"></td>
164 <td></td>
165 <td class="paramtype">uint&#160;</td>
166 <td class="paramname"><em>src_step_x</em>, </td>
167 </tr>
168 <tr>
169 <td class="paramkey"></td>
170 <td></td>
171 <td class="paramtype">uint&#160;</td>
172 <td class="paramname"><em>src_stride_y</em>, </td>
173 </tr>
174 <tr>
175 <td class="paramkey"></td>
176 <td></td>
177 <td class="paramtype">uint&#160;</td>
178 <td class="paramname"><em>src_step_y</em>, </td>
179 </tr>
180 <tr>
181 <td class="paramkey"></td>
182 <td></td>
183 <td class="paramtype">uint&#160;</td>
184 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
185 </tr>
186 <tr>
187 <td class="paramkey"></td>
188 <td></td>
189 <td class="paramtype">__global uchar *&#160;</td>
190 <td class="paramname"><em>dst_ptr</em>, </td>
191 </tr>
192 <tr>
193 <td class="paramkey"></td>
194 <td></td>
195 <td class="paramtype">uint&#160;</td>
196 <td class="paramname"><em>dst_stride_x</em>, </td>
197 </tr>
198 <tr>
199 <td class="paramkey"></td>
200 <td></td>
201 <td class="paramtype">uint&#160;</td>
202 <td class="paramname"><em>dst_step_x</em>, </td>
203 </tr>
204 <tr>
205 <td class="paramkey"></td>
206 <td></td>
207 <td class="paramtype">uint&#160;</td>
208 <td class="paramname"><em>dst_stride_y</em>, </td>
209 </tr>
210 <tr>
211 <td class="paramkey"></td>
212 <td></td>
213 <td class="paramtype">uint&#160;</td>
214 <td class="paramname"><em>dst_step_y</em>, </td>
215 </tr>
216 <tr>
217 <td class="paramkey"></td>
218 <td></td>
219 <td class="paramtype">uint&#160;</td>
220 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>&#160;</td>
221 </tr>
222 <tr>
223 <td></td>
224 <td>)</td>
225 <td></td><td></td>
226 </tr>
227 </table>
228</div><div class="memdoc">
229
230<p>This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. </p>
231<dl class="params"><dt>Parameters</dt><dd>
232 <table class="params">
Kaizen8938bd32017-09-28 14:38:23 +0100233 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U16/S16/QS16/F16 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000234 <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>
235 <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>
236 <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>
237 <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>
238 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100239 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000240 <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>
241 <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>
242 <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>
243 <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>
244 <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>
245 </table>
246 </dd>
247</dl>
248
Kaizen8938bd32017-09-28 14:38:23 +0100249<p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00182">182</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000250
Kaizen8938bd32017-09-28 14:38:23 +0100251<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00292">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>.</p>
252<div class="fragment"><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;{</div>
253<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="comment">/* Compute source and destination addresses */</span></div>
254<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <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>
255<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <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>
256<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;</div>
257<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">/* Load values from Matrix A */</span></div>
258<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; ushort8 a0 = vload8(0, (__global ushort *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 0)));</div>
259<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; ushort8 a1 = vload8(0, (__global ushort *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 1)));</div>
260<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; ushort8 a2 = vload8(0, (__global ushort *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 2)));</div>
261<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; ushort8 a3 = vload8(0, (__global ushort *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 3)));</div>
262<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
263<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; ushort8 val0 = (ushort8)((ushort4)(a0.s0, a1.s0, a2.s0, a3.s0), (ushort4)(a0.s1, a1.s1, a2.s1, a3.s1));</div>
264<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; vstore8(val0, 0, ((__global ushort *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 0);</div>
265<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;</div>
266<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; val0 = (ushort8)((ushort4)(a0.s2, a1.s2, a2.s2, a3.s2), (ushort4)(a0.s3, a1.s3, a2.s3, a3.s3));</div>
267<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; vstore8(val0, 0, ((__global ushort *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 8);</div>
268<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;</div>
269<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; val0 = (ushort8)((ushort4)(a0.s4, a1.s4, a2.s4, a3.s4), (ushort4)(a0.s5, a1.s5, a2.s5, a3.s5));</div>
270<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; vstore8(val0, 0, ((__global ushort *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 16);</div>
271<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;</div>
272<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; val0 = (ushort8)((ushort4)(a0.s6, a1.s6, a2.s6, a3.s6), (ushort4)(a0.s7, a1.s7, a2.s7, a3.s7));</div>
273<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; vstore8(val0, 0, ((__global ushort *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 24);</div>
274<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;}</div>
275<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#l00292">helpers.h:292</a></div></div>
276<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#l00093">helpers.h:93</a></div></div>
277<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#l00131">helpers.h:131</a></div></div>
278<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#l00133">helpers.h:133</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000279</div><!-- fragment -->
280</div>
281</div>
Anthony Barbier46d59272017-05-04 09:15:15 +0100282<a class="anchor" id="a560b2d50aa886edc0f5daf4fe729717f"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000283<div class="memitem">
284<div class="memproto">
285 <table class="memname">
286 <tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100287 <td class="memname">__kernel void gemm_interleave4x4_32bit </td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000288 <td>(</td>
289 <td class="paramtype">__global uchar *&#160;</td>
290 <td class="paramname"><em>src_ptr</em>, </td>
291 </tr>
292 <tr>
293 <td class="paramkey"></td>
294 <td></td>
295 <td class="paramtype">uint&#160;</td>
296 <td class="paramname"><em>src_stride_x</em>, </td>
297 </tr>
298 <tr>
299 <td class="paramkey"></td>
300 <td></td>
301 <td class="paramtype">uint&#160;</td>
302 <td class="paramname"><em>src_step_x</em>, </td>
303 </tr>
304 <tr>
305 <td class="paramkey"></td>
306 <td></td>
307 <td class="paramtype">uint&#160;</td>
308 <td class="paramname"><em>src_stride_y</em>, </td>
309 </tr>
310 <tr>
311 <td class="paramkey"></td>
312 <td></td>
313 <td class="paramtype">uint&#160;</td>
314 <td class="paramname"><em>src_step_y</em>, </td>
315 </tr>
316 <tr>
317 <td class="paramkey"></td>
318 <td></td>
319 <td class="paramtype">uint&#160;</td>
320 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
321 </tr>
322 <tr>
323 <td class="paramkey"></td>
324 <td></td>
325 <td class="paramtype">__global uchar *&#160;</td>
326 <td class="paramname"><em>dst_ptr</em>, </td>
327 </tr>
328 <tr>
329 <td class="paramkey"></td>
330 <td></td>
331 <td class="paramtype">uint&#160;</td>
332 <td class="paramname"><em>dst_stride_x</em>, </td>
333 </tr>
334 <tr>
335 <td class="paramkey"></td>
336 <td></td>
337 <td class="paramtype">uint&#160;</td>
338 <td class="paramname"><em>dst_step_x</em>, </td>
339 </tr>
340 <tr>
341 <td class="paramkey"></td>
342 <td></td>
343 <td class="paramtype">uint&#160;</td>
344 <td class="paramname"><em>dst_stride_y</em>, </td>
345 </tr>
346 <tr>
347 <td class="paramkey"></td>
348 <td></td>
349 <td class="paramtype">uint&#160;</td>
350 <td class="paramname"><em>dst_step_y</em>, </td>
351 </tr>
352 <tr>
353 <td class="paramkey"></td>
354 <td></td>
355 <td class="paramtype">uint&#160;</td>
356 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>&#160;</td>
357 </tr>
358 <tr>
359 <td></td>
360 <td>)</td>
361 <td></td><td></td>
362 </tr>
363 </table>
364</div><div class="memdoc">
365
366<p>This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. </p>
367<dl class="params"><dt>Parameters</dt><dd>
368 <table class="params">
Anthony Barbier46d59272017-05-04 09:15:15 +0100369 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U32/S32/F32 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000370 <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>
371 <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>
372 <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>
373 <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>
374 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100375 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000376 <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>
377 <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>
378 <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>
379 <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>
380 <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>
381 </table>
382 </dd>
383</dl>
384
Kaizen8938bd32017-09-28 14:38:23 +0100385<p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00141">141</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000386
Kaizen8938bd32017-09-28 14:38:23 +0100387<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00292">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>.</p>
388<div class="fragment"><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;{</div>
389<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="comment">/* Compute source and destination addresses */</span></div>
390<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <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>
391<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <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>
392<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div>
393<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="comment">/* Load values from Matrix A */</span></div>
394<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; uint4 a0 = vload4(0, (__global uint *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 0)));</div>
395<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; uint4 a1 = vload4(0, (__global uint *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 1)));</div>
396<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; uint4 a2 = vload4(0, (__global uint *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 2)));</div>
397<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; uint4 a3 = vload4(0, (__global uint *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 3)));</div>
398<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div>
399<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; uint4 val0 = (uint4)(a0.s0, a1.s0, a2.s0, a3.s0);</div>
400<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; vstore4(val0, 0, ((__global uint *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 0);</div>
401<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;</div>
402<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; val0 = (uint4)(a0.s1, a1.s1, a2.s1, a3.s1);</div>
403<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; vstore4(val0, 0, ((__global uint *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 4);</div>
404<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div>
405<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; val0 = (uint4)(a0.s2, a1.s2, a2.s2, a3.s2);</div>
406<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; vstore4(val0, 0, ((__global uint *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 8);</div>
407<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
408<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; val0 = (uint4)(a0.s3, a1.s3, a2.s3, a3.s3);</div>
409<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; vstore4(val0, 0, ((__global uint *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 12);</div>
410<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;}</div>
411<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#l00292">helpers.h:292</a></div></div>
412<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#l00093">helpers.h:93</a></div></div>
413<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#l00131">helpers.h:131</a></div></div>
414<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#l00133">helpers.h:133</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000415</div><!-- fragment -->
416</div>
417</div>
Anthony Barbier46d59272017-05-04 09:15:15 +0100418<a class="anchor" id="aa66a7b6b0420e54ec173743e6c5bfc45"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000419<div class="memitem">
420<div class="memproto">
421 <table class="memname">
422 <tr>
Anthony Barbier46d59272017-05-04 09:15:15 +0100423 <td class="memname">__kernel void gemm_interleave4x4_8bit </td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000424 <td>(</td>
425 <td class="paramtype">__global uchar *&#160;</td>
426 <td class="paramname"><em>src_ptr</em>, </td>
427 </tr>
428 <tr>
429 <td class="paramkey"></td>
430 <td></td>
431 <td class="paramtype">uint&#160;</td>
432 <td class="paramname"><em>src_stride_x</em>, </td>
433 </tr>
434 <tr>
435 <td class="paramkey"></td>
436 <td></td>
437 <td class="paramtype">uint&#160;</td>
438 <td class="paramname"><em>src_step_x</em>, </td>
439 </tr>
440 <tr>
441 <td class="paramkey"></td>
442 <td></td>
443 <td class="paramtype">uint&#160;</td>
444 <td class="paramname"><em>src_stride_y</em>, </td>
445 </tr>
446 <tr>
447 <td class="paramkey"></td>
448 <td></td>
449 <td class="paramtype">uint&#160;</td>
450 <td class="paramname"><em>src_step_y</em>, </td>
451 </tr>
452 <tr>
453 <td class="paramkey"></td>
454 <td></td>
455 <td class="paramtype">uint&#160;</td>
456 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
457 </tr>
458 <tr>
459 <td class="paramkey"></td>
460 <td></td>
461 <td class="paramtype">__global uchar *&#160;</td>
462 <td class="paramname"><em>dst_ptr</em>, </td>
463 </tr>
464 <tr>
465 <td class="paramkey"></td>
466 <td></td>
467 <td class="paramtype">uint&#160;</td>
468 <td class="paramname"><em>dst_stride_x</em>, </td>
469 </tr>
470 <tr>
471 <td class="paramkey"></td>
472 <td></td>
473 <td class="paramtype">uint&#160;</td>
474 <td class="paramname"><em>dst_step_x</em>, </td>
475 </tr>
476 <tr>
477 <td class="paramkey"></td>
478 <td></td>
479 <td class="paramtype">uint&#160;</td>
480 <td class="paramname"><em>dst_stride_y</em>, </td>
481 </tr>
482 <tr>
483 <td class="paramkey"></td>
484 <td></td>
485 <td class="paramtype">uint&#160;</td>
486 <td class="paramname"><em>dst_step_y</em>, </td>
487 </tr>
488 <tr>
489 <td class="paramkey"></td>
490 <td></td>
491 <td class="paramtype">uint&#160;</td>
492 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>&#160;</td>
493 </tr>
494 <tr>
495 <td></td>
496 <td>)</td>
497 <td></td><td></td>
498 </tr>
499 </table>
500</div><div class="memdoc">
501
502<p>This OpenCL kernel reshapes the input matrix transposing each 4x4 block and interleaving the values. </p>
503<dl class="params"><dt>Parameters</dt><dd>
504 <table class="params">
Kaizen8938bd32017-09-28 14:38:23 +0100505 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U8/S8/QS8 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000506 <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>
507 <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>
508 <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>
509 <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>
510 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100511 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000512 <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>
513 <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>
514 <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>
515 <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>
516 <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>
517 </table>
518 </dd>
519</dl>
520
Kaizen8938bd32017-09-28 14:38:23 +0100521<p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00223">223</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000522
Kaizen8938bd32017-09-28 14:38:23 +0100523<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00292">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>.</p>
524<div class="fragment"><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;{</div>
525<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="comment">/* Compute source and destination addresses */</span></div>
526<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <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>
527<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <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>
528<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
529<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">/* Load values from Matrix A */</span></div>
530<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; uchar16 a0 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 0)));</div>
531<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; uchar16 a1 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 1)));</div>
532<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; uchar16 a2 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 2)));</div>
533<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uchar16 a3 = vload16(0, (__global uchar *)(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, 3)));</div>
534<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;</div>
535<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; uchar16 val0 = (uchar16)((uchar4)(a0.s0, a1.s0, a2.s0, a3.s0), (uchar4)(a0.s1, a1.s1, a2.s1, a3.s1),</div>
536<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; (uchar4)(a0.s2, a1.s2, a2.s2, a3.s2), (uchar4)(a0.s3, a1.s3, a2.s3, a3.s3));</div>
537<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 0);</div>
538<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div>
539<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; val0 = (uchar16)((uchar4)(a0.s4, a1.s4, a2.s4, a3.s4), (uchar4)(a0.s5, a1.s5, a2.s5, a3.s5),</div>
540<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; (uchar4)(a0.s6, a1.s6, a2.s6, a3.s6), (uchar4)(a0.s7, a1.s7, a2.s7, a3.s7));</div>
541<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 16);</div>
542<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;</div>
543<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; val0 = (uchar16)((uchar4)(a0.s8, a1.s8, a2.s8, a3.s8), (uchar4)(a0.s9, a1.s9, a2.s9, a3.s9),</div>
544<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; (uchar4)(a0.sA, a1.sA, a2.sA, a3.sA), (uchar4)(a0.sB, a1.sB, a2.sB, a3.sB));</div>
545<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 32);</div>
546<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;</div>
547<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; val0 = (uchar16)((uchar4)(a0.sC, a1.sC, a2.sC, a3.sC), (uchar4)(a0.sD, a1.sD, a2.sD, a3.sD),</div>
548<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; (uchar4)(a0.sE, a1.sE, a2.sE, a3.sE), (uchar4)(a0.sF, a1.sF, a2.sF, a3.sF));</div>
549<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; vstore16(val0, 0, ((__global uchar *)dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) + 48);</div>
550<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;}</div>
551<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#l00292">helpers.h:292</a></div></div>
552<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#l00093">helpers.h:93</a></div></div>
553<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#l00131">helpers.h:131</a></div></div>
554<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#l00133">helpers.h:133</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000555</div><!-- fragment -->
556</div>
557</div>
Kaizen8938bd32017-09-28 14:38:23 +0100558<a class="anchor" id="a97a299ffb620aa98fe5e39bb8ab0833f"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000559<div class="memitem">
560<div class="memproto">
561 <table class="memname">
562 <tr>
Kaizen8938bd32017-09-28 14:38:23 +0100563 <td class="memname">__kernel void gemm_transpose1x16 </td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000564 <td>(</td>
565 <td class="paramtype">__global uchar *&#160;</td>
566 <td class="paramname"><em>src_ptr</em>, </td>
567 </tr>
568 <tr>
569 <td class="paramkey"></td>
570 <td></td>
571 <td class="paramtype">uint&#160;</td>
572 <td class="paramname"><em>src_stride_x</em>, </td>
573 </tr>
574 <tr>
575 <td class="paramkey"></td>
576 <td></td>
577 <td class="paramtype">uint&#160;</td>
578 <td class="paramname"><em>src_step_x</em>, </td>
579 </tr>
580 <tr>
581 <td class="paramkey"></td>
582 <td></td>
583 <td class="paramtype">uint&#160;</td>
584 <td class="paramname"><em>src_stride_y</em>, </td>
585 </tr>
586 <tr>
587 <td class="paramkey"></td>
588 <td></td>
589 <td class="paramtype">uint&#160;</td>
590 <td class="paramname"><em>src_step_y</em>, </td>
591 </tr>
592 <tr>
593 <td class="paramkey"></td>
594 <td></td>
595 <td class="paramtype">uint&#160;</td>
596 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
597 </tr>
598 <tr>
599 <td class="paramkey"></td>
600 <td></td>
601 <td class="paramtype">__global uchar *&#160;</td>
602 <td class="paramname"><em>dst_ptr</em>, </td>
603 </tr>
604 <tr>
605 <td class="paramkey"></td>
606 <td></td>
607 <td class="paramtype">uint&#160;</td>
608 <td class="paramname"><em>dst_stride_x</em>, </td>
609 </tr>
610 <tr>
611 <td class="paramkey"></td>
612 <td></td>
613 <td class="paramtype">uint&#160;</td>
614 <td class="paramname"><em>dst_step_x</em>, </td>
615 </tr>
616 <tr>
617 <td class="paramkey"></td>
618 <td></td>
619 <td class="paramtype">uint&#160;</td>
620 <td class="paramname"><em>dst_stride_y</em>, </td>
621 </tr>
622 <tr>
623 <td class="paramkey"></td>
624 <td></td>
625 <td class="paramtype">uint&#160;</td>
626 <td class="paramname"><em>dst_step_y</em>, </td>
627 </tr>
628 <tr>
629 <td class="paramkey"></td>
630 <td></td>
631 <td class="paramtype">uint&#160;</td>
632 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>&#160;</td>
633 </tr>
634 <tr>
635 <td></td>
636 <td>)</td>
637 <td></td><td></td>
638 </tr>
639 </table>
640</div><div class="memdoc">
641
642<p>This OpenCL kernel computes the "vector" 1x16 transposition of input matrix. </p>
643<dl class="params"><dt>Parameters</dt><dd>
644 <table class="params">
Kaizen8938bd32017-09-28 14:38:23 +0100645 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U8/S8/QS8 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000646 <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>
647 <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>
648 <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>
649 <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>
650 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100651 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000652 <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>
653 <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>
654 <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>
655 <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>
656 <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>
657 </table>
658 </dd>
659</dl>
660
Kaizen8938bd32017-09-28 14:38:23 +0100661<p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00109">109</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000662
Kaizen8938bd32017-09-28 14:38:23 +0100663<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>.</p>
664<div class="fragment"><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;{</div>
665<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; uint x = get_global_id(0);</div>
666<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; uint y = get_global_id(1);</div>
667<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div>
668<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">/* Compute address for Matrix B - source */</span></div>
669<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <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>
670<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
671<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">/* Compute address for Matrix B transposed - destination. X and Y are swapped */</span></div>
672<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; uint dst_addr_in_bytes = y * 16 + ((x * dst_stride_y + dst_offset_first_element_in_bytes));</div>
673<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div>
674<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; uchar16 b0 = vload16(0, (__global uchar *)src.ptr);</div>
675<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
676<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; vstore16(b0, 0, (__global uchar *)(dst_ptr + dst_addr_in_bytes));</div>
677<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;}</div>
678<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#l00093">helpers.h:93</a></div></div>
679<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#l00131">helpers.h:131</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000680</div><!-- fragment -->
681</div>
682</div>
Kaizen8938bd32017-09-28 14:38:23 +0100683<a class="anchor" id="ac5eba21b9ac015e1454044aeba93546c"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000684<div class="memitem">
685<div class="memproto">
686 <table class="memname">
687 <tr>
Kaizen8938bd32017-09-28 14:38:23 +0100688 <td class="memname">__kernel void gemm_transpose1x4 </td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000689 <td>(</td>
690 <td class="paramtype">__global uchar *&#160;</td>
691 <td class="paramname"><em>src_ptr</em>, </td>
692 </tr>
693 <tr>
694 <td class="paramkey"></td>
695 <td></td>
696 <td class="paramtype">uint&#160;</td>
697 <td class="paramname"><em>src_stride_x</em>, </td>
698 </tr>
699 <tr>
700 <td class="paramkey"></td>
701 <td></td>
702 <td class="paramtype">uint&#160;</td>
703 <td class="paramname"><em>src_step_x</em>, </td>
704 </tr>
705 <tr>
706 <td class="paramkey"></td>
707 <td></td>
708 <td class="paramtype">uint&#160;</td>
709 <td class="paramname"><em>src_stride_y</em>, </td>
710 </tr>
711 <tr>
712 <td class="paramkey"></td>
713 <td></td>
714 <td class="paramtype">uint&#160;</td>
715 <td class="paramname"><em>src_step_y</em>, </td>
716 </tr>
717 <tr>
718 <td class="paramkey"></td>
719 <td></td>
720 <td class="paramtype">uint&#160;</td>
721 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
722 </tr>
723 <tr>
724 <td class="paramkey"></td>
725 <td></td>
726 <td class="paramtype">__global uchar *&#160;</td>
727 <td class="paramname"><em>dst_ptr</em>, </td>
728 </tr>
729 <tr>
730 <td class="paramkey"></td>
731 <td></td>
732 <td class="paramtype">uint&#160;</td>
733 <td class="paramname"><em>dst_stride_x</em>, </td>
734 </tr>
735 <tr>
736 <td class="paramkey"></td>
737 <td></td>
738 <td class="paramtype">uint&#160;</td>
739 <td class="paramname"><em>dst_step_x</em>, </td>
740 </tr>
741 <tr>
742 <td class="paramkey"></td>
743 <td></td>
744 <td class="paramtype">uint&#160;</td>
745 <td class="paramname"><em>dst_stride_y</em>, </td>
746 </tr>
747 <tr>
748 <td class="paramkey"></td>
749 <td></td>
750 <td class="paramtype">uint&#160;</td>
751 <td class="paramname"><em>dst_step_y</em>, </td>
752 </tr>
753 <tr>
754 <td class="paramkey"></td>
755 <td></td>
756 <td class="paramtype">uint&#160;</td>
757 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>&#160;</td>
758 </tr>
759 <tr>
760 <td></td>
761 <td>)</td>
762 <td></td><td></td>
763 </tr>
764 </table>
765</div><div class="memdoc">
766
767<p>This OpenCL kernel computes the "vector" 1x4 transposition of input matrix. </p>
768<dl class="params"><dt>Parameters</dt><dd>
769 <table class="params">
Kaizen8938bd32017-09-28 14:38:23 +0100770 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U32/S32/F32 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000771 <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>
772 <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>
773 <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>
774 <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>
775 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100776 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000777 <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>
778 <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>
779 <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>
780 <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>
781 <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>
782 </table>
783 </dd>
784</dl>
785
Kaizen8938bd32017-09-28 14:38:23 +0100786<p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00045">45</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000787
Kaizen8938bd32017-09-28 14:38:23 +0100788<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>.</p>
789<div class="fragment"><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;{</div>
790<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; uint x = get_global_id(0);</div>
791<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; uint y = get_global_id(1);</div>
792<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div>
793<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="comment">// Compute address for Matrix B - source</span></div>
794<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <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>
795<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div>
796<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="comment">// Compute address for Matrix B transposed - destination. X and Y are swapped</span></div>
797<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; uint dst_addr_in_bytes = y * 16 + ((x * dst_stride_y + dst_offset_first_element_in_bytes));</div>
798<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div>
799<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; uint4 b0 = vload4(0, (__global uint *)src.ptr);</div>
800<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div>
801<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; vstore4(b0, 0, (__global uint *)(dst_ptr + dst_addr_in_bytes));</div>
802<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;}</div>
803<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#l00093">helpers.h:93</a></div></div>
804<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#l00131">helpers.h:131</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000805</div><!-- fragment -->
806</div>
807</div>
Kaizen8938bd32017-09-28 14:38:23 +0100808<a class="anchor" id="a75c35ac120f123e9cce56c43ba3f48d2"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000809<div class="memitem">
810<div class="memproto">
811 <table class="memname">
812 <tr>
Kaizen8938bd32017-09-28 14:38:23 +0100813 <td class="memname">__kernel void gemm_transpose1x8 </td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000814 <td>(</td>
815 <td class="paramtype">__global uchar *&#160;</td>
816 <td class="paramname"><em>src_ptr</em>, </td>
817 </tr>
818 <tr>
819 <td class="paramkey"></td>
820 <td></td>
821 <td class="paramtype">uint&#160;</td>
822 <td class="paramname"><em>src_stride_x</em>, </td>
823 </tr>
824 <tr>
825 <td class="paramkey"></td>
826 <td></td>
827 <td class="paramtype">uint&#160;</td>
828 <td class="paramname"><em>src_step_x</em>, </td>
829 </tr>
830 <tr>
831 <td class="paramkey"></td>
832 <td></td>
833 <td class="paramtype">uint&#160;</td>
834 <td class="paramname"><em>src_stride_y</em>, </td>
835 </tr>
836 <tr>
837 <td class="paramkey"></td>
838 <td></td>
839 <td class="paramtype">uint&#160;</td>
840 <td class="paramname"><em>src_step_y</em>, </td>
841 </tr>
842 <tr>
843 <td class="paramkey"></td>
844 <td></td>
845 <td class="paramtype">uint&#160;</td>
846 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
847 </tr>
848 <tr>
849 <td class="paramkey"></td>
850 <td></td>
851 <td class="paramtype">__global uchar *&#160;</td>
852 <td class="paramname"><em>dst_ptr</em>, </td>
853 </tr>
854 <tr>
855 <td class="paramkey"></td>
856 <td></td>
857 <td class="paramtype">uint&#160;</td>
858 <td class="paramname"><em>dst_stride_x</em>, </td>
859 </tr>
860 <tr>
861 <td class="paramkey"></td>
862 <td></td>
863 <td class="paramtype">uint&#160;</td>
864 <td class="paramname"><em>dst_step_x</em>, </td>
865 </tr>
866 <tr>
867 <td class="paramkey"></td>
868 <td></td>
869 <td class="paramtype">uint&#160;</td>
870 <td class="paramname"><em>dst_stride_y</em>, </td>
871 </tr>
872 <tr>
873 <td class="paramkey"></td>
874 <td></td>
875 <td class="paramtype">uint&#160;</td>
876 <td class="paramname"><em>dst_step_y</em>, </td>
877 </tr>
878 <tr>
879 <td class="paramkey"></td>
880 <td></td>
881 <td class="paramtype">uint&#160;</td>
882 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>&#160;</td>
883 </tr>
884 <tr>
885 <td></td>
886 <td>)</td>
887 <td></td><td></td>
888 </tr>
889 </table>
890</div><div class="memdoc">
891
892<p>This OpenCL kernel computes the "vector" 1x8 transposition of input matrix. </p>
893<dl class="params"><dt>Parameters</dt><dd>
894 <table class="params">
Kaizen8938bd32017-09-28 14:38:23 +0100895 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source matrix. Supported data types: U16/S16/QS16/F16 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000896 <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>
897 <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>
898 <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>
899 <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>
900 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100901 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination matrix Supported data types: same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000902 <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>
903 <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>
904 <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>
905 <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>
906 <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>
907 </table>
908 </dd>
909</dl>
910
Kaizen8938bd32017-09-28 14:38:23 +0100911<p>Definition at line <a class="el" href="gemm_8cl_source.xhtml#l00077">77</a> of file <a class="el" href="gemm_8cl_source.xhtml">gemm.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000912
Kaizen8938bd32017-09-28 14:38:23 +0100913<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>.</p>
914<div class="fragment"><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;{</div>
915<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; uint x = get_global_id(0);</div>
916<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; uint y = get_global_id(1);</div>
917<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div>
918<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">/* Compute address for Matrix B - source */</span></div>
919<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <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>
920<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div>
921<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">/* Compute address for Matrix B transposed - destination. X and Y are swapped */</span></div>
922<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; uint dst_addr_in_bytes = y * 16 + ((x * dst_stride_y + dst_offset_first_element_in_bytes));</div>
923<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div>
924<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; ushort8 b0 = vload8(0, (__global ushort *)src.ptr);</div>
925<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
926<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; vstore8(b0, 0, (__global ushort *)(dst_ptr + dst_addr_in_bytes));</div>
927<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;}</div>
928<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#l00093">helpers.h:93</a></div></div>
929<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#l00131">helpers.h:131</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000930</div><!-- fragment -->
931</div>
932</div>
933</div><!-- contents -->
934</div><!-- doc-content -->
935<!-- start footer part -->
936<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
937 <ul>
Kaizen8938bd32017-09-28 14:38:23 +0100938 <li class="navelem"><a class="el" href="dir_55b5a5006e943fb664ff8cff3cfe7768.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_f6c3ae42d7e27145d0a3c3e38ca1c000.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_1b7ae9123c88e650426d50d95c19d414.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_b7c3d80b0dadb2139bc73b7161751c12.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="gemm_8cl.xhtml">gemm.cl</a></li>
939 <li class="footer">Generated on Thu Sep 28 2017 14:37:53 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000940 <a href="http://www.doxygen.org/index.html">
Kaizen8938bd32017-09-28 14:38:23 +0100941 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000942 </ul>
943</div>
944</body>
945</html>