| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.8.17"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>mxnet: /work/mxnet/3rdparty/mshadow/mshadow/extension/implicit_gemm.h Source File</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/searchdata.js"></script> |
| <script type="text/javascript" src="search/search.js"></script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <td id="projectalign" style="padding-left: 0.5em;"> |
| <div id="projectname">mxnet |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.17 --> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| /* @license-end */ |
| </script> |
| <script type="text/javascript" src="menudata.js"></script> |
| <script type="text/javascript" src="menu.js"></script> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(function() { |
| initMenu('',true,false,'search.php','Search'); |
| $(document).ready(function() { init_search(); }); |
| }); |
| /* @license-end */</script> |
| <div id="main-nav"></div> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| </div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <iframe src="javascript:void(0)" frameborder="0" |
| name="MSearchResults" id="MSearchResults"> |
| </iframe> |
| </div> |
| |
| <div id="nav-path" class="navpath"> |
| <ul> |
| <li class="navelem"><a class="el" href="dir_8cab8f464681f7cc51cee77e79a434cd.html">3rdparty</a></li><li class="navelem"><a class="el" href="dir_3e48ced36faa4eaa1b41f6d960bf0edb.html">mshadow</a></li><li class="navelem"><a class="el" href="dir_00b035bb2ad81894e6ad291054ea5f82.html">mshadow</a></li><li class="navelem"><a class="el" href="dir_9bd2a322a448ef0abedd860cb1ca3721.html">extension</a></li> </ul> |
| </div> |
| </div><!-- top --> |
| <div class="header"> |
| <div class="headertitle"> |
| <div class="title">implicit_gemm.h</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <a href="implicit__gemm_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div> |
| <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one</span></div> |
| <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * or more contributor license agreements. See the NOTICE file</span></div> |
| <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * distributed with this work for additional information</span></div> |
| <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * regarding copyright ownership. The ASF licenses this file</span></div> |
| <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * to you under the Apache License, Version 2.0 (the</span></div> |
| <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * "License"); you may not use this file except in compliance</span></div> |
| <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * with the License. You may obtain a copy of the License at</span></div> |
| <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div> |
| <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div> |
| <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> *</span></div> |
| <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * Unless required by applicable law or agreed to in writing,</span></div> |
| <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * software distributed under the License is distributed on an</span></div> |
| <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div> |
| <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * KIND, either express or implied. See the License for the</span></div> |
| <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * specific language governing permissions and limitations</span></div> |
| <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * under the License.</span></div> |
| <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> */</span></div> |
| <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div> |
| <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#ifndef MSHADOW_EXTENSION_IMPLICIT_GEMM_H_</span></div> |
| <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#define MSHADOW_EXTENSION_IMPLICIT_GEMM_H_</span></div> |
| <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  </div> |
| <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "../extension.h"</span></div> |
| <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "../packet-inl.h"</span></div> |
| <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  </div> |
| <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">namespace </span><a class="code" href="namespacemshadow.html">mshadow</a> {</div> |
| <div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">namespace </span>expr {</div> |
| <div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">template</span><<span class="keyword">typename</span> LhsExp, <span class="keyword">typename</span> RhsExp, <span class="keyword">typename</span> DType></div> |
| <div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html"> 40</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp</a>:</div> |
| <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keyword">public</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">Exp</a><ImplicitGEMMExp<LhsExp, RhsExp, DType>,</div> |
| <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  DType, type::kChainer> {</div> |
| <div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a5bc9c26177407ccc872560b20fbb3d5f"> 44</a></span>  <span class="keyword">const</span> LhsExp &<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a5bc9c26177407ccc872560b20fbb3d5f">lhs_</a>;</div> |
| <div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a012467415e838b426ba07db7ecd0a677"> 46</a></span>  <span class="keyword">const</span> RhsExp &<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a012467415e838b426ba07db7ecd0a677">rhs_</a>;</div> |
| <div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a7ef84d7f53017173e983d59e9bf7ce7d"> 48</a></span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a7ef84d7f53017173e983d59e9bf7ce7d">prod_size_</a>;</div> |
| <div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#adc71663458f470b378529894a55db0b5"> 50</a></span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#adc71663458f470b378529894a55db0b5">shape_</a>;</div> |
| <div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#ad2c6095c1fa976f90dc462e18d77a1b9"> 52</a></span>  <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#ad2c6095c1fa976f90dc462e18d77a1b9">ImplicitGEMMExp</a>(<span class="keyword">const</span> LhsExp &lhs, <span class="keyword">const</span> RhsExp &rhs)</div> |
| <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  : <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a5bc9c26177407ccc872560b20fbb3d5f">lhs_</a>(lhs), <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a012467415e838b426ba07db7ecd0a677">rhs_</a>(rhs) {</div> |
| <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> slhs = <a class="code" href="structmshadow_1_1expr_1_1ShapeCheck.html#af44e6a3b97cf3b245bc1b7ad4cacb306">ShapeCheck<2, LhsExp>::Check</a>(<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a5bc9c26177407ccc872560b20fbb3d5f">lhs_</a>);</div> |
| <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> srhs = <a class="code" href="structmshadow_1_1expr_1_1ShapeCheck.html#af44e6a3b97cf3b245bc1b7ad4cacb306">ShapeCheck<2, RhsExp>::Check</a>(<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a012467415e838b426ba07db7ecd0a677">rhs_</a>);</div> |
| <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  this->shape_ = <a class="code" href="namespacemshadow.html#ad2853583180a7dbe9cbf6b0e15ae60ef">mshadow::Shape2</a>(slhs[0], srhs[1]);</div> |
| <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a7ef84d7f53017173e983d59e9bf7ce7d">prod_size_</a> = slhs[1];</div> |
| <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  }</div> |
| <div class="line"><a name="l00059"></a><span class="lineno"> 59</span> };</div> |
| <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  </div> |
| <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div> |
| <div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">template</span><<span class="keyword">typename</span> LhsExp, <span class="keyword">typename</span> RhsExp, <span class="keyword">typename</span> DType, <span class="keywordtype">int</span> e1, <span class="keywordtype">int</span> e2></div> |
| <div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="keyword">inline</span> ImplicitGEMMExp<LhsExp, RhsExp, DType></div> |
| <div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="namespacemshadow_1_1expr.html#aef7b5fe2e264d0bb3a83de21836acd99"> 64</a></span> <a class="code" href="namespacemshadow_1_1expr.html#aef7b5fe2e264d0bb3a83de21836acd99">implicit_dot</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">Exp<LhsExp, DType, e1></a> &lhs,</div> |
| <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">Exp<RhsExp, DType, e2></a> &rhs) {</div> |
| <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="structmshadow_1_1expr_1_1TypeCheckPass.html">TypeCheckPass<ExpInfo<LhsExp>::kDim</a> == 2 && <a class="code" href="structmshadow_1_1expr_1_1ExpInfo.html">ExpInfo<RhsExp>::kDim</a> == 2></div> |
| <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  ::Error_Expression_Does_Not_Meet_Dimension_Req();</div> |
| <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp<LhsExp, RhsExp, DType></a>(lhs.<a class="code" href="structmshadow_1_1expr_1_1Exp.html#adb7e4afd0baed78d66cff87de0a6621f">self</a>(), rhs.<a class="code" href="structmshadow_1_1expr_1_1Exp.html#adb7e4afd0baed78d66cff87de0a6621f">self</a>());</div> |
| <div class="line"><a name="l00069"></a><span class="lineno"> 69</span> }</div> |
| <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div> |
| <div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment">//----------------------</span></div> |
| <div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// Execution plan</span></div> |
| <div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment">//----------------------</span></div> |
| <div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">template</span><<span class="keyword">typename</span> LhsExp, <span class="keyword">typename</span> RhsExp, <span class="keyword">typename</span> DType></div> |
| <div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html"> 75</a></span> <span class="keyword">struct </span><a class="code" href="classmshadow_1_1expr_1_1Plan.html">Plan</a><<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp</a><LhsExp, RhsExp, DType>, DType> {</div> |
| <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keyword">public</span>:</div> |
| <div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html#aef0dd4a081ba8f361a9c97b555400b77"> 77</a></span>  <span class="keyword">explicit</span> <a class="code" href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html#aef0dd4a081ba8f361a9c97b555400b77">Plan</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp<LhsExp, RhsExp, DType></a> &e)</div> |
| <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  : lhs_(<a class="code" href="namespacemshadow_1_1expr.html#aefd008a0bf012dc8fb99d9bbcca7a078">MakePlan</a>(e.lhs_)),</div> |
| <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  rhs_(<a class="code" href="namespacemshadow_1_1expr.html#aefd008a0bf012dc8fb99d9bbcca7a078">MakePlan</a>(e.rhs_)),</div> |
| <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  prod_size_(e.prod_size_),</div> |
| <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  prod_size_lower_align_(packet::<a class="code" href="namespacemshadow_1_1packet.html#aae366b300131f5212f480e9602ea232e">LowerAlign</a><DType, <a class="code" href="packet-inl_8h.html#a958737730f9e52e5d5b9cbab79ad357e">MSHADOW_DEFAULT_PACKET</a>>(e.prod_size_)) {</div> |
| <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  }</div> |
| <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  </div> |
| <div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html#ad7d437ce8a87b28fe32e8be4352836dc"> 84</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> DType <a class="code" href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html#ad7d437ce8a87b28fe32e8be4352836dc">Eval</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> y, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> x)<span class="keyword"> const </span>{</div> |
| <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keyword">typedef</span> <a class="code" href="structmshadow_1_1packet_1_1Packet.html">packet::Packet<DType></a> Packet;</div> |
| <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  Packet sum = Packet::Fill(0);</div> |
| <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div> |
| <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> packetSize = Packet::size;</div> |
| <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  DType lhs_temp[packetSize], rhs_temp[packetSize];</div> |
| <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div> |
| <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">for</span> (<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> i = 0; i < prod_size_lower_align_; i += packetSize) {</div> |
| <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">// unroll</span></div> |
| <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordflow">for</span> (<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> j = 0; j < packetSize; ++j) {</div> |
| <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  lhs_temp[j] = lhs_.Eval(y, i + j);</div> |
| <div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div> |
| <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">for</span> (<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> j = 0; j < packetSize; ++j) {</div> |
| <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  rhs_temp[j] = rhs_.Eval(i + j, x);</div> |
| <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  }</div> |
| <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  sum = sum + Packet::LoadUnAligned(lhs_temp) * Packet::LoadUnAligned(rhs_temp);</div> |
| <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div> |
| <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  DType ret_result = sum.Sum();</div> |
| <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  </div> |
| <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">for</span> (<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> i = prod_size_lower_align_; i < prod_size_; ++i) {</div> |
| <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  ret_result += lhs_.Eval(y, i) * rhs_.Eval(i, x);</div> |
| <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  }</div> |
| <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span> ret_result;</div> |
| <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>  </div> |
| <div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keyword">private</span>:</div> |
| <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <a class="code" href="classmshadow_1_1expr_1_1Plan.html">expr::Plan<LhsExp, DType></a> lhs_;</div> |
| <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <a class="code" href="classmshadow_1_1expr_1_1Plan.html">expr::Plan<RhsExp, DType></a> rhs_;</div> |
| <div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keyword">const</span> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> prod_size_;</div> |
| <div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">const</span> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> prod_size_lower_align_;</div> |
| <div class="line"><a name="l00114"></a><span class="lineno"> 114</span> };</div> |
| <div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  </div> |
| <div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="keyword">template</span><<span class="keyword">typename</span> LhsExp, <span class="keyword">typename</span> RhsExp, <span class="keyword">typename</span> DType></div> |
| <div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="keyword">inline</span> Plan<ImplicitGEMMExp<LhsExp, RhsExp, DType>, DType></div> |
| <div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="namespacemshadow_1_1expr.html#a31137eaaa2acbfd9379ec855504732e7"> 118</a></span> <a class="code" href="namespacemshadow_1_1expr.html#aefd008a0bf012dc8fb99d9bbcca7a078">MakePlan</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp<LhsExp, RhsExp, DType></a> &exp) {</div> |
| <div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">return</span> <a class="code" href="classmshadow_1_1expr_1_1Plan.html">Plan<ImplicitGEMMExp<LhsExp, RhsExp, DType></a>, DType>(exp);</div> |
| <div class="line"><a name="l00120"></a><span class="lineno"> 120</span> }</div> |
| <div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  </div> |
| <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  </div> |
| <div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> LhsExp, <span class="keyword">typename</span> RhsExp, <span class="keyword">typename</span> DType></div> |
| <div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ShapeCheck_3_01dim_00_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html"> 124</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1expr_1_1ShapeCheck.html">ShapeCheck</a><dim, <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp</a><LhsExp, RhsExp, DType> > {</div> |
| <div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<dim></a></div> |
| <div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ShapeCheck_3_01dim_00_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html#a6eac94d02bbba7f51f5251313703c9d5"> 126</a></span>  <a class="code" href="structmshadow_1_1expr_1_1ShapeCheck_3_01dim_00_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html#a6eac94d02bbba7f51f5251313703c9d5">Check</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp<LhsExp, RhsExp, DType></a> &t) {</div> |
| <div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  CHECK(dim == 2)</div> |
| <div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  << <span class="stringliteral">"ImplicitGEMMExp only support 2 dimension"</span>;</div> |
| <div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<dim></a> shape1 = <a class="code" href="structmshadow_1_1expr_1_1ShapeCheck.html#af44e6a3b97cf3b245bc1b7ad4cacb306">ShapeCheck<dim, LhsExp>::Check</a>(t.<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a5bc9c26177407ccc872560b20fbb3d5f">lhs_</a>);</div> |
| <div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<dim></a> shape2 = <a class="code" href="structmshadow_1_1expr_1_1ShapeCheck.html#af44e6a3b97cf3b245bc1b7ad4cacb306">ShapeCheck<dim, RhsExp>::Check</a>(t.<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a012467415e838b426ba07db7ecd0a677">rhs_</a>);</div> |
| <div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  CHECK_EQ(shape1[1], shape2[0])</div> |
| <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  << <span class="stringliteral">"implicit_dot The matrix shape do not match"</span>;</div> |
| <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">return</span> t.<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#adc71663458f470b378529894a55db0b5">shape_</a>;</div> |
| <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div> |
| <div class="line"><a name="l00135"></a><span class="lineno"> 135</span> };</div> |
| <div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  </div> |
| <div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <span class="keyword">template</span><<span class="keyword">typename</span> LhsExp, <span class="keyword">typename</span> RhsExp, <span class="keyword">typename</span> DType></div> |
| <div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ExpInfo_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html"> 138</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1expr_1_1ExpInfo.html">ExpInfo</a><<a class="code" href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">ImplicitGEMMExp</a><LhsExp, RhsExp, DType> > {</div> |
| <div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ExpInfo_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html#a3cf34441d29b03e9f7bb3e7ee39e9cad"> 139</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="structmshadow_1_1expr_1_1ExpInfo.html#a0b0afc287b577f89dc3eb119c2fef778">kDim</a> = 2;</div> |
| <div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="structmshadow_1_1expr_1_1ExpInfo_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html#ae6d8c4d9b0961ad059e88da8d8db7ddd"> 140</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="structmshadow_1_1expr_1_1ExpInfo.html#a610f3258c19b544f4056ea78c3259eb7">kDevMask</a> = <a class="code" href="structmshadow_1_1expr_1_1ExpInfo.html">ExpInfo<LhsExp>::kDevMask</a> & <a class="code" href="structmshadow_1_1expr_1_1ExpInfo.html">ExpInfo<RhsExp>::kDevMask</a>;</div> |
| <div class="line"><a name="l00141"></a><span class="lineno"> 141</span> };</div> |
| <div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  </div> |
| <div class="line"><a name="l00143"></a><span class="lineno"> 143</span> } <span class="comment">// namespace expr</span></div> |
| <div class="line"><a name="l00144"></a><span class="lineno"> 144</span> } <span class="comment">// namespace mshadow</span></div> |
| <div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="preprocessor">#endif // MSHADOW_EXTENSION_IMPLICIT_GEMM_H_</span></div> |
| <div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div> |
| </div><!-- fragment --></div><!-- contents --> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ExpInfo_html_a610f3258c19b544f4056ea78c3259eb7"><div class="ttname"><a href="structmshadow_1_1expr_1_1ExpInfo.html#a610f3258c19b544f4056ea78c3259eb7">mshadow::expr::ExpInfo::kDevMask</a></div><div class="ttdeci">static const int kDevMask</div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:264</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1Exp_html_adb7e4afd0baed78d66cff87de0a6621f"><div class="ttname"><a href="structmshadow_1_1expr_1_1Exp.html#adb7e4afd0baed78d66cff87de0a6621f">mshadow::expr::Exp::self</a></div><div class="ttdeci">const SubType & self(void) const</div><div class="ttdef"><b>Definition:</b> expression.h:82</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ImplicitGEMMExp_html_a7ef84d7f53017173e983d59e9bf7ce7d"><div class="ttname"><a href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a7ef84d7f53017173e983d59e9bf7ce7d">mshadow::expr::ImplicitGEMMExp::prod_size_</a></div><div class="ttdeci">index_t prod_size_</div><div class="ttdoc">internal production size</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:48</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1TypeCheckPass_html"><div class="ttname"><a href="structmshadow_1_1expr_1_1TypeCheckPass.html">mshadow::expr::TypeCheckPass</a></div><div class="ttdoc">used to help static type check</div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:330</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ImplicitGEMMExp_html_ad2c6095c1fa976f90dc462e18d77a1b9"><div class="ttname"><a href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#ad2c6095c1fa976f90dc462e18d77a1b9">mshadow::expr::ImplicitGEMMExp::ImplicitGEMMExp</a></div><div class="ttdeci">ImplicitGEMMExp(const LhsExp &lhs, const RhsExp &rhs)</div><div class="ttdoc">constructor</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:52</div></div> |
| <div class="ttc" id="astructmshadow_1_1packet_1_1Packet_html"><div class="ttname"><a href="structmshadow_1_1packet_1_1Packet.html">mshadow::packet::Packet</a></div><div class="ttdoc">Generic packet type.</div><div class="ttdef"><b>Definition:</b> packet-inl.h:59</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ImplicitGEMMExp_html_a012467415e838b426ba07db7ecd0a677"><div class="ttname"><a href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a012467415e838b426ba07db7ecd0a677">mshadow::expr::ImplicitGEMMExp::rhs_</a></div><div class="ttdeci">const RhsExp & rhs_</div><div class="ttdoc">rhs operand</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:46</div></div> |
| <div class="ttc" id="a3rdparty_2mshadow_2mshadow_2base_8h_html_af205b8ab4d8733133d590df7d2639d69"><div class="ttname"><a href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a></div><div class="ttdeci">#define MSHADOW_XINLINE</div><div class="ttdef"><b>Definition:</b> base.h:228</div></div> |
| <div class="ttc" id="anamespacemshadow_1_1packet_html_aae366b300131f5212f480e9602ea232e"><div class="ttname"><a href="namespacemshadow_1_1packet.html#aae366b300131f5212f480e9602ea232e">mshadow::packet::LowerAlign</a></div><div class="ttdeci">index_t LowerAlign(index_t size)</div><div class="ttdoc">get lower bound of aligned index of size</div><div class="ttdef"><b>Definition:</b> packet-inl.h:146</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ShapeCheck_html"><div class="ttname"><a href="structmshadow_1_1expr_1_1ShapeCheck.html">mshadow::expr::ShapeCheck</a></div><div class="ttdoc">runtime shape checking template get the shape of an expression, report error if shape mismatch</div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:364</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ShapeCheck_html_af44e6a3b97cf3b245bc1b7ad4cacb306"><div class="ttname"><a href="structmshadow_1_1expr_1_1ShapeCheck.html#af44e6a3b97cf3b245bc1b7ad4cacb306">mshadow::expr::ShapeCheck::Check</a></div><div class="ttdeci">static Shape< dim > Check(const E &t)</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ExpInfo_html"><div class="ttname"><a href="structmshadow_1_1expr_1_1ExpInfo.html">mshadow::expr::ExpInfo</a></div><div class="ttdoc">static type inference template, used to get the dimension of each expression, if ExpInfo<E>::kDim == ...</div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:262</div></div> |
| <div class="ttc" id="anamespacemshadow_1_1expr_html_aefd008a0bf012dc8fb99d9bbcca7a078"><div class="ttname"><a href="namespacemshadow_1_1expr.html#aefd008a0bf012dc8fb99d9bbcca7a078">mshadow::expr::MakePlan</a></div><div class="ttdeci">Plan< BinaryMapExp< OP, TA, TB, DType, etype >, DType > MakePlan(const BinaryMapExp< OP, TA, TB, DType, etype > &e)</div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:239</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ShapeCheck_3_01dim_00_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4_html_a6eac94d02bbba7f51f5251313703c9d5"><div class="ttname"><a href="structmshadow_1_1expr_1_1ShapeCheck_3_01dim_00_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_01_4.html#a6eac94d02bbba7f51f5251313703c9d5">mshadow::expr::ShapeCheck< dim, ImplicitGEMMExp< LhsExp, RhsExp, DType > >::Check</a></div><div class="ttdeci">static Shape< dim > Check(const ImplicitGEMMExp< LhsExp, RhsExp, DType > &t)</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:126</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ExpInfo_html_a0b0afc287b577f89dc3eb119c2fef778"><div class="ttname"><a href="structmshadow_1_1expr_1_1ExpInfo.html#a0b0afc287b577f89dc3eb119c2fef778">mshadow::expr::ExpInfo::kDim</a></div><div class="ttdeci">static const int kDim</div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:263</div></div> |
| <div class="ttc" id="anamespacemshadow_html_adcbc2e1131386fccb1474b0bdf045926"><div class="ttname"><a href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">mshadow::index_t</a></div><div class="ttdeci">int32_t index_t</div><div class="ttdoc">type that will be used for index</div><div class="ttdef"><b>Definition:</b> base.h:328</div></div> |
| <div class="ttc" id="aclassmshadow_1_1expr_1_1Plan_html"><div class="ttname"><a href="classmshadow_1_1expr_1_1Plan.html">mshadow::expr::Plan</a></div><div class="ttdef"><b>Definition:</b> expr_engine-inl.h:58</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ImplicitGEMMExp_html_adc71663458f470b378529894a55db0b5"><div class="ttname"><a href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#adc71663458f470b378529894a55db0b5">mshadow::expr::ImplicitGEMMExp::shape_</a></div><div class="ttdeci">Shape< 2 > shape_</div><div class="ttdoc">the shape of this expression</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:50</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1Exp_html"><div class="ttname"><a href="structmshadow_1_1expr_1_1Exp.html">mshadow::expr::Exp</a></div><div class="ttdoc">defines how expression exp can be evaluated and stored into dst</div><div class="ttdef"><b>Definition:</b> expression.h:79</div></div> |
| <div class="ttc" id="anamespacemshadow_1_1expr_html_aef7b5fe2e264d0bb3a83de21836acd99"><div class="ttname"><a href="namespacemshadow_1_1expr.html#aef7b5fe2e264d0bb3a83de21836acd99">mshadow::expr::implicit_dot</a></div><div class="ttdeci">ImplicitGEMMExp< LhsExp, RhsExp, DType > implicit_dot(const Exp< LhsExp, DType, e1 > &lhs, const Exp< RhsExp, DType, e2 > &rhs)</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:64</div></div> |
| <div class="ttc" id="anamespacemshadow_html"><div class="ttname"><a href="namespacemshadow.html">mshadow</a></div><div class="ttdoc">overloaded + operator between half_t and bf16_t</div><div class="ttdef"><b>Definition:</b> base.h:319</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ImplicitGEMMExp_html_a5bc9c26177407ccc872560b20fbb3d5f"><div class="ttname"><a href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html#a5bc9c26177407ccc872560b20fbb3d5f">mshadow::expr::ImplicitGEMMExp::lhs_</a></div><div class="ttdeci">const LhsExp & lhs_</div><div class="ttdoc">lhs operand</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:44</div></div> |
| <div class="ttc" id="anamespacemshadow_html_ad2853583180a7dbe9cbf6b0e15ae60ef"><div class="ttname"><a href="namespacemshadow.html#ad2853583180a7dbe9cbf6b0e15ae60ef">mshadow::Shape2</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 2 > Shape2(index_t s0, index_t s1)</div><div class="ttdoc">construct a two dimension shape, stride will equal s0</div><div class="ttdef"><b>Definition:</b> tensor.h:230</div></div> |
| <div class="ttc" id="astructmshadow_1_1Shape_html"><div class="ttname"><a href="structmshadow_1_1Shape.html">mshadow::Shape< 2 ></a></div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4_html_aef0dd4a081ba8f361a9c97b555400b77"><div class="ttname"><a href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html#aef0dd4a081ba8f361a9c97b555400b77">mshadow::expr::Plan< ImplicitGEMMExp< LhsExp, RhsExp, DType >, DType >::Plan</a></div><div class="ttdeci">Plan(const ImplicitGEMMExp< LhsExp, RhsExp, DType > &e)</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:77</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1ImplicitGEMMExp_html"><div class="ttname"><a href="structmshadow_1_1expr_1_1ImplicitGEMMExp.html">mshadow::expr::ImplicitGEMMExp</a></div><div class="ttdoc">Matrix multiplication.</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:40</div></div> |
| <div class="ttc" id="apacket-inl_8h_html_a958737730f9e52e5d5b9cbab79ad357e"><div class="ttname"><a href="packet-inl_8h.html#a958737730f9e52e5d5b9cbab79ad357e">MSHADOW_DEFAULT_PACKET</a></div><div class="ttdeci">#define MSHADOW_DEFAULT_PACKET</div><div class="ttdef"><b>Definition:</b> packet-inl.h:47</div></div> |
| <div class="ttc" id="astructmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4_html_ad7d437ce8a87b28fe32e8be4352836dc"><div class="ttname"><a href="structmshadow_1_1expr_1_1Plan_3_01ImplicitGEMMExp_3_01LhsExp_00_01RhsExp_00_01DType_01_4_00_01DType_01_4.html#ad7d437ce8a87b28fe32e8be4352836dc">mshadow::expr::Plan< ImplicitGEMMExp< LhsExp, RhsExp, DType >, DType >::Eval</a></div><div class="ttdeci">MSHADOW_XINLINE DType Eval(index_t y, index_t x) const</div><div class="ttdef"><b>Definition:</b> implicit_gemm.h:84</div></div> |
| <!-- start footer part --> |
| <hr class="footer"/><address class="footer"><small> |
| Generated on Sat Nov 5 2022 01:16:57 for mxnet by  <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/> |
| </a> 1.8.17 |
| </small></address> |
| </body> |
| </html> |