cutlass/docs/device__memory_8h_source.html

147 lines
52 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.11"/>
<title>CUTLASS: device_memory.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>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.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="projectlogo"><img alt="Logo" src="cutlass-logo-small.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">CUTLASS
</div>
<div id="projectbrief">CUDA Templates for Linear Algebra Subroutines and Solvers</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</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_4eeb864c4eec08c7d6b9d3b0352cfdde.html">tools</a></li><li class="navelem"><a class="el" href="dir_88de82f9e8d739a2f42f92d95f0d7933.html">util</a></li><li class="navelem"><a class="el" href="dir_7e9e609009df72bf6226de354e72c328.html">include</a></li><li class="navelem"><a class="el" href="dir_ade2f6ff57439d30f4164e14e54bcf30.html">cutlass</a></li><li class="navelem"><a class="el" href="dir_ff60863f958a43c892071bb1f8a4c81a.html">util</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">device_memory.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="device__memory_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>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * modification, are not permitted.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="platform_8h.html">cutlass/platform/platform.h</a>&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="numeric__types_8h.html">cutlass/numeric_types.h</a>&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="exceptions_8h.html">exceptions.h</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacecutlass.html">cutlass</a> {</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html"> 34</a></span>&#160;<span class="keyword">namespace </span>device_memory {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment"> * Allocation lifetime</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a345678796dcc23b33b4288e26c9b029f"> 42</a></span>&#160;T* <a class="code" href="namespacecutlass_1_1device__memory.html#a345678796dcc23b33b4288e26c9b029f">allocate</a>(<span class="keywordtype">size_t</span> count = 1) {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; T* ptr = 0;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordtype">size_t</span> bytes = <span class="keyword">sizeof</span>(T) * count;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; cudaError_t cuda_error = cudaMalloc((<span class="keywordtype">void</span>**)&amp;ptr, bytes);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">if</span> (cuda_error != cudaSuccess) {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keywordflow">throw</span> <a class="code" href="classcutlass_1_1cuda__exception.html">cuda_exception</a>(<span class="stringliteral">&quot;Failed to allocate memory&quot;</span>, cuda_error);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; }</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">return</span> ptr;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;}</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#ae1978e48f195a60ad01e94815b35bdac"> 56</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#ae1978e48f195a60ad01e94815b35bdac">free</a>(T* ptr) {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">if</span> (ptr) {</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; cudaError_t cuda_error = (cudaFree(ptr));</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordflow">if</span> (cuda_error != cudaSuccess) {</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">throw</span> <a class="code" href="classcutlass_1_1cuda__exception.html">cuda_exception</a>(<span class="stringliteral">&quot;Failed to free device memory&quot;</span>, cuda_error);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; }</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; }</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;}</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="comment"> * Data movement</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93"> 70</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93">copy</a>(T* dst, T <span class="keyword">const</span>* src, <span class="keywordtype">size_t</span> count, cudaMemcpyKind kind) {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordtype">size_t</span> bytes = count * <a class="code" href="structcutlass_1_1sizeof__bits.html">sizeof_bits&lt;T&gt;::value</a> / 8;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">if</span> (bytes == 0 &amp;&amp; count &gt; 0)</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; bytes = 1;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; cudaError_t cuda_error = (cudaMemcpy(dst, src, bytes, kind));</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">if</span> (cuda_error != cudaSuccess) {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">throw</span> <a class="code" href="classcutlass_1_1cuda__exception.html">cuda_exception</a>(<span class="stringliteral">&quot;cudaMemcpy() failed&quot;</span>, cuda_error);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;}</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#adce1a75429c0eae9d34dc18944777325"> 81</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#adce1a75429c0eae9d34dc18944777325">copy_to_device</a>(T* dst, T <span class="keyword">const</span>* src, <span class="keywordtype">size_t</span> count = 1) {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93">copy</a>(dst, src, count, cudaMemcpyHostToDevice);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;}</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a5333f291105136d2e8e4c31329d93c31"> 86</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#a5333f291105136d2e8e4c31329d93c31">copy_to_host</a>(T* dst, T <span class="keyword">const</span>* src, <span class="keywordtype">size_t</span> count = 1) {</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93">copy</a>(dst, src, count, cudaMemcpyDeviceToHost);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;}</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a8ff6151b081442db9af7421110c0242b"> 91</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#a8ff6151b081442db9af7421110c0242b">copy_device_to_device</a>(T* dst, T <span class="keyword">const</span>* src, <span class="keywordtype">size_t</span> count = 1) {</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93">copy</a>(dst, src, count, cudaMemcpyDeviceToDevice);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;}</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a0a3ab26e6c9a8aae6b09bfb3e4eb24e8"> 96</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#a0a3ab26e6c9a8aae6b09bfb3e4eb24e8">copy_host_to_host</a>(T* dst, T <span class="keyword">const</span>* src, <span class="keywordtype">size_t</span> count = 1) {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93">copy</a>(dst, src, count, cudaMemcpyHostToHost);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;}</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> OutputIterator, <span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a72db7a89f91c55a23a3cb51e48951709"> 102</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#a72db7a89f91c55a23a3cb51e48951709">insert_to_host</a>(OutputIterator begin, OutputIterator end, T <span class="keyword">const</span>* device_begin) {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordtype">size_t</span> elements = end - begin;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a5333f291105136d2e8e4c31329d93c31">copy_to_host</a>(&amp;*begin, device_begin, elements);</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;}</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> InputIterator&gt;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="namespacecutlass_1_1device__memory.html#a8eec1bf6dd3ff9f8fdb339a9735e6b09"> 109</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecutlass_1_1device__memory.html#a8eec1bf6dd3ff9f8fdb339a9735e6b09">insert_to_device</a>(T* device_begin, InputIterator begin, InputIterator end) {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordtype">size_t</span> elements = end - begin;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#adce1a75429c0eae9d34dc18944777325">copy_to_device</a>(device_begin, &amp;*begin, elements);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;}</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="comment"> * &quot;Smart&quot; device memory allocation</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html"> 120</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structcutlass_1_1device__memory_1_1allocation.html">allocation</a> {</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation_1_1deleter.html"> 122</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structcutlass_1_1device__memory_1_1allocation_1_1deleter.html">deleter</a> {</div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation_1_1deleter.html#a21c95062a05aba32c3aa8551458ab4e2"> 123</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structcutlass_1_1device__memory_1_1allocation_1_1deleter.html#a21c95062a05aba32c3aa8551458ab4e2">operator()</a>(T* ptr) {</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; cudaError_t cuda_error = (cudaFree(ptr));</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">if</span> (cuda_error != cudaSuccess) {</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="comment">// noexcept</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="comment">// throw cuda_exception(&quot;cudaFree() failed&quot;, cuda_error);</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">return</span>;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; }</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; }</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; };</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="comment">// Data members</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6"> 138</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">capacity</a>;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a4a37fda293871522f10dad153fdf55f4"> 141</a></span>&#160; <a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html">platform::unique_ptr&lt;T, deleter&gt;</a> <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a4a37fda293871522f10dad153fdf55f4">smart_ptr</a>;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="comment">// Methods</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a49b392100679f307f116fc0f854bad0a"> 148</a></span>&#160; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a49b392100679f307f116fc0f854bad0a">allocation</a>() : capacity(0) {}</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a87b81eac219bdc38af93cad71beab87a"> 151</a></span>&#160; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a87b81eac219bdc38af93cad71beab87a">allocation</a>(<span class="keywordtype">size_t</span> _capacity) : smart_ptr(<a class="code" href="namespacecutlass_1_1device__memory.html#a345678796dcc23b33b4288e26c9b029f">allocate</a>&lt;T&gt;(_capacity)), capacity(_capacity) {}</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a73138c905fb54cfb1556914cb6d106c7"> 154</a></span>&#160; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a73138c905fb54cfb1556914cb6d106c7">allocation</a>(<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html">allocation</a> <span class="keyword">const</span> &amp;p): smart_ptr(<a class="code" href="namespacecutlass_1_1device__memory.html#a345678796dcc23b33b4288e26c9b029f">allocate</a>&lt;T&gt;(p.capacity)), capacity(p.capacity) {</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a8ff6151b081442db9af7421110c0242b">copy_device_to_device</a>(smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a2e7c14b8a118f81c1df46ea5045e297b">get</a>(), p.<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a86356748c671059942168502dd58684a">get</a>(), <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">capacity</a>);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; }</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#af205dd59859566d6fab5ac3eea8de7bf"> 159</a></span>&#160; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#af205dd59859566d6fab5ac3eea8de7bf">~allocation</a>() { <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#aeef3a1cb8cfb96a2823e85f7fa52a31a">reset</a>(); }</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a86356748c671059942168502dd58684a"> 162</a></span>&#160; T* <span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a2e7c14b8a118f81c1df46ea5045e297b">get</a>(); }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a138bc02627aab06ac09c73da67f06f7a"> 165</a></span>&#160; T* <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a138bc02627aab06ac09c73da67f06f7a">release</a>() {</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; capacity = 0;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">return</span> smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a7ac06ebe7bc66573d3225891e12d2279">release</a>();</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; }</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#aeef3a1cb8cfb96a2823e85f7fa52a31a"> 171</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#aeef3a1cb8cfb96a2823e85f7fa52a31a">reset</a>() {</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; capacity = 0;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a6740f71511f5495d6038cf8878862331">reset</a>();</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; }</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a325a56e50f82d0a1aa0425d3ae061405"> 177</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a325a56e50f82d0a1aa0425d3ae061405">reset</a>(T* _ptr, <span class="keywordtype">size_t</span> _capacity) {</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a6740f71511f5495d6038cf8878862331">reset</a>(_ptr);</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; capacity = _capacity;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; }</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a793e663af04f7fb81f7df710147c8fc8"> 183</a></span>&#160; T* <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a793e663af04f7fb81f7df710147c8fc8">operator-&gt;</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a2e7c14b8a118f81c1df46ea5045e297b">get</a>(); }</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a8066ac4f1897e4a9031fe1cfbd40b9ef"> 186</a></span>&#160; deleter&amp; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a8066ac4f1897e4a9031fe1cfbd40b9ef">get_deleter</a>() { <span class="keywordflow">return</span> smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a5b8d8ecafb4da336acd50e40cd42b6e0">get_deleter</a>(); }</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a9f4ac6b947801d56521e8b6eefb72c2f"> 189</a></span>&#160; <span class="keyword">const</span> deleter&amp; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a9f4ac6b947801d56521e8b6eefb72c2f">get_deleter</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a5b8d8ecafb4da336acd50e40cd42b6e0">get_deleter</a>(); }</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="structcutlass_1_1device__memory_1_1allocation.html#a3d6109a5a85d407b2e43d34766af1d85"> 192</a></span>&#160; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html">allocation</a> &amp; <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a3d6109a5a85d407b2e43d34766af1d85">operator=</a>(<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html">allocation</a> <span class="keyword">const</span> &amp;p) {</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordflow">if</span> (capacity != p.<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">capacity</a>) {</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a6740f71511f5495d6038cf8878862331">reset</a>(allocate&lt;T&gt;(p.<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">capacity</a>));</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; capacity = p.<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">capacity</a>;</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; }</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <a class="code" href="namespacecutlass_1_1device__memory.html#a8ff6151b081442db9af7421110c0242b">copy_device_to_device</a>(smart_ptr.<a class="code" href="classcutlass_1_1platform_1_1unique__ptr.html#a2e7c14b8a118f81c1df46ea5045e297b">get</a>(), p.<a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a86356748c671059942168502dd58684a">get</a>(), <a class="code" href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">capacity</a>);</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; }</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;};</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;} <span class="comment">// namespace device_memory</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;} <span class="comment">// namespace cutlass</span></div><div class="ttc" id="namespacecutlass_html"><div class="ttname"><a href="namespacecutlass.html">cutlass</a></div><div class="ttdef"><b>Definition:</b> aligned_buffer.h:35</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a87b81eac219bdc38af93cad71beab87a"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a87b81eac219bdc38af93cad71beab87a">cutlass::device_memory::allocation::allocation</a></div><div class="ttdeci">allocation(size_t _capacity)</div><div class="ttdoc">Constructor: allocates capacity elements on the current CUDA device. </div><div class="ttdef"><b>Definition:</b> device_memory.h:151</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a8eec1bf6dd3ff9f8fdb339a9735e6b09"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a8eec1bf6dd3ff9f8fdb339a9735e6b09">cutlass::device_memory::insert_to_device</a></div><div class="ttdeci">void insert_to_device(T *device_begin, InputIterator begin, InputIterator end)</div><div class="ttdoc">Copies elements to device memory from host-side range. </div><div class="ttdef"><b>Definition:</b> device_memory.h:109</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a8066ac4f1897e4a9031fe1cfbd40b9ef"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a8066ac4f1897e4a9031fe1cfbd40b9ef">cutlass::device_memory::allocation::get_deleter</a></div><div class="ttdeci">deleter &amp; get_deleter()</div><div class="ttdoc">Returns the deleter object which would be used for destruction of the managed object. </div><div class="ttdef"><b>Definition:</b> device_memory.h:186</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_adce1a75429c0eae9d34dc18944777325"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#adce1a75429c0eae9d34dc18944777325">cutlass::device_memory::copy_to_device</a></div><div class="ttdeci">void copy_to_device(T *dst, T const *src, size_t count=1)</div><div class="ttdef"><b>Definition:</b> device_memory.h:81</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a117e201964852b2b3e228d81eaf73f93"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a117e201964852b2b3e228d81eaf73f93">cutlass::device_memory::copy</a></div><div class="ttdeci">void copy(T *dst, T const *src, size_t count, cudaMemcpyKind kind)</div><div class="ttdef"><b>Definition:</b> device_memory.h:70</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_1_1deleter_html_a21c95062a05aba32c3aa8551458ab4e2"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation_1_1deleter.html#a21c95062a05aba32c3aa8551458ab4e2">cutlass::device_memory::allocation::deleter::operator()</a></div><div class="ttdeci">void operator()(T *ptr)</div><div class="ttdef"><b>Definition:</b> device_memory.h:123</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a86356748c671059942168502dd58684a"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a86356748c671059942168502dd58684a">cutlass::device_memory::allocation::get</a></div><div class="ttdeci">T * get() const </div><div class="ttdoc">Returns a pointer to the managed object. </div><div class="ttdef"><b>Definition:</b> device_memory.h:162</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_aeef3a1cb8cfb96a2823e85f7fa52a31a"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#aeef3a1cb8cfb96a2823e85f7fa52a31a">cutlass::device_memory::allocation::reset</a></div><div class="ttdeci">void reset()</div><div class="ttdoc">Deletes the managed object and resets capacity to zero. </div><div class="ttdef"><b>Definition:</b> device_memory.h:171</div></div>
<div class="ttc" id="platform_8h_html"><div class="ttname"><a href="platform_8h.html">platform.h</a></div><div class="ttdoc">C++ features that may be otherwise unimplemented for CUDA device functions. </div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_1_1deleter_html"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation_1_1deleter.html">cutlass::device_memory::allocation::deleter</a></div><div class="ttdoc">Delete functor for CUDA device memory. </div><div class="ttdef"><b>Definition:</b> device_memory.h:122</div></div>
<div class="ttc" id="classcutlass_1_1platform_1_1unique__ptr_html"><div class="ttname"><a href="classcutlass_1_1platform_1_1unique__ptr.html">cutlass::platform::unique_ptr</a></div><div class="ttdoc">std::unique_ptr </div><div class="ttdef"><b>Definition:</b> platform.h:712</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a138bc02627aab06ac09c73da67f06f7a"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a138bc02627aab06ac09c73da67f06f7a">cutlass::device_memory::allocation::release</a></div><div class="ttdeci">T * release()</div><div class="ttdoc">Releases the ownership of the managed object (without deleting) and resets capacity to zero...</div><div class="ttdef"><b>Definition:</b> device_memory.h:165</div></div>
<div class="ttc" id="classcutlass_1_1platform_1_1unique__ptr_html_a2e7c14b8a118f81c1df46ea5045e297b"><div class="ttname"><a href="classcutlass_1_1platform_1_1unique__ptr.html#a2e7c14b8a118f81c1df46ea5045e297b">cutlass::platform::unique_ptr::get</a></div><div class="ttdeci">pointer get() const noexcept</div><div class="ttdoc">Returns a pointer to the managed object or nullptr if no object is owned. </div><div class="ttdef"><b>Definition:</b> platform.h:735</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a345678796dcc23b33b4288e26c9b029f"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a345678796dcc23b33b4288e26c9b029f">cutlass::device_memory::allocate</a></div><div class="ttdeci">T * allocate(size_t count=1)</div><div class="ttdoc">Allocate a buffer of count elements of type T on the current CUDA device. </div><div class="ttdef"><b>Definition:</b> device_memory.h:42</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a4a37fda293871522f10dad153fdf55f4"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a4a37fda293871522f10dad153fdf55f4">cutlass::device_memory::allocation::smart_ptr</a></div><div class="ttdeci">platform::unique_ptr&lt; T, deleter &gt; smart_ptr</div><div class="ttdoc">Smart pointer. </div><div class="ttdef"><b>Definition:</b> device_memory.h:141</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a81d1c8ae7ffc695ae1e6a190ebfe8bb6"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a81d1c8ae7ffc695ae1e6a190ebfe8bb6">cutlass::device_memory::allocation::capacity</a></div><div class="ttdeci">size_t capacity</div><div class="ttdoc">Number of elements of T allocated on the current CUDA device. </div><div class="ttdef"><b>Definition:</b> device_memory.h:138</div></div>
<div class="ttc" id="structcutlass_1_1sizeof__bits_html"><div class="ttname"><a href="structcutlass_1_1sizeof__bits.html">cutlass::sizeof_bits</a></div><div class="ttdoc">Defines the size of an element in bits. </div><div class="ttdef"><b>Definition:</b> numeric_types.h:42</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a0a3ab26e6c9a8aae6b09bfb3e4eb24e8"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a0a3ab26e6c9a8aae6b09bfb3e4eb24e8">cutlass::device_memory::copy_host_to_host</a></div><div class="ttdeci">void copy_host_to_host(T *dst, T const *src, size_t count=1)</div><div class="ttdef"><b>Definition:</b> device_memory.h:96</div></div>
<div class="ttc" id="exceptions_8h_html"><div class="ttname"><a href="exceptions_8h.html">exceptions.h</a></div><div class="ttdoc">C++ exception semantics for CUDA error codes. </div></div>
<div class="ttc" id="numeric__types_8h_html"><div class="ttname"><a href="numeric__types_8h.html">numeric_types.h</a></div><div class="ttdoc">Top-level include for all CUTLASS numeric types. </div></div>
<div class="ttc" id="classcutlass_1_1platform_1_1unique__ptr_html_a5b8d8ecafb4da336acd50e40cd42b6e0"><div class="ttname"><a href="classcutlass_1_1platform_1_1unique__ptr.html#a5b8d8ecafb4da336acd50e40cd42b6e0">cutlass::platform::unique_ptr::get_deleter</a></div><div class="ttdeci">Deleter &amp; get_deleter() noexcept</div><div class="ttdoc">Returns the deleter object. </div><div class="ttdef"><b>Definition:</b> platform.h:757</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a793e663af04f7fb81f7df710147c8fc8"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a793e663af04f7fb81f7df710147c8fc8">cutlass::device_memory::allocation::operator-&gt;</a></div><div class="ttdeci">T * operator-&gt;() const </div><div class="ttdoc">Returns a pointer to the object owned by *this. </div><div class="ttdef"><b>Definition:</b> device_memory.h:183</div></div>
<div class="ttc" id="classcutlass_1_1platform_1_1unique__ptr_html_a6740f71511f5495d6038cf8878862331"><div class="ttname"><a href="classcutlass_1_1platform_1_1unique__ptr.html#a6740f71511f5495d6038cf8878862331">cutlass::platform::unique_ptr::reset</a></div><div class="ttdeci">void reset(pointer p=pointer()) noexcept</div><div class="ttdoc">Replaces the managed object, deleting the old object. </div><div class="ttdef"><b>Definition:</b> platform.h:745</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a5333f291105136d2e8e4c31329d93c31"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a5333f291105136d2e8e4c31329d93c31">cutlass::device_memory::copy_to_host</a></div><div class="ttdeci">void copy_to_host(T *dst, T const *src, size_t count=1)</div><div class="ttdef"><b>Definition:</b> device_memory.h:86</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_af205dd59859566d6fab5ac3eea8de7bf"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#af205dd59859566d6fab5ac3eea8de7bf">cutlass::device_memory::allocation::~allocation</a></div><div class="ttdeci">~allocation()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> device_memory.h:159</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a9f4ac6b947801d56521e8b6eefb72c2f"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a9f4ac6b947801d56521e8b6eefb72c2f">cutlass::device_memory::allocation::get_deleter</a></div><div class="ttdeci">const deleter &amp; get_deleter() const </div><div class="ttdoc">Returns the deleter object which would be used for destruction of the managed object (const) ...</div><div class="ttdef"><b>Definition:</b> device_memory.h:189</div></div>
<div class="ttc" id="classcutlass_1_1cuda__exception_html"><div class="ttname"><a href="classcutlass_1_1cuda__exception.html">cutlass::cuda_exception</a></div><div class="ttdoc">C++ exception wrapper for CUDA cudaError_t. </div><div class="ttdef"><b>Definition:</b> exceptions.h:36</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a3d6109a5a85d407b2e43d34766af1d85"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a3d6109a5a85d407b2e43d34766af1d85">cutlass::device_memory::allocation::operator=</a></div><div class="ttdeci">allocation &amp; operator=(allocation const &amp;p)</div><div class="ttdoc">Copies a device-side memory allocation. </div><div class="ttdef"><b>Definition:</b> device_memory.h:192</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a49b392100679f307f116fc0f854bad0a"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a49b392100679f307f116fc0f854bad0a">cutlass::device_memory::allocation::allocation</a></div><div class="ttdeci">allocation()</div><div class="ttdoc">Constructor: allocates no memory. </div><div class="ttdef"><b>Definition:</b> device_memory.h:148</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a325a56e50f82d0a1aa0425d3ae061405"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a325a56e50f82d0a1aa0425d3ae061405">cutlass::device_memory::allocation::reset</a></div><div class="ttdeci">void reset(T *_ptr, size_t _capacity)</div><div class="ttdoc">Deletes managed object, if owned, and replaces its reference with a given pointer and capacity...</div><div class="ttdef"><b>Definition:</b> device_memory.h:177</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_ae1978e48f195a60ad01e94815b35bdac"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#ae1978e48f195a60ad01e94815b35bdac">cutlass::device_memory::free</a></div><div class="ttdeci">void free(T *ptr)</div><div class="ttdoc">Free the buffer pointed to by ptr. </div><div class="ttdef"><b>Definition:</b> device_memory.h:56</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a72db7a89f91c55a23a3cb51e48951709"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a72db7a89f91c55a23a3cb51e48951709">cutlass::device_memory::insert_to_host</a></div><div class="ttdeci">void insert_to_host(OutputIterator begin, OutputIterator end, T const *device_begin)</div><div class="ttdoc">Copies elements from device memory to host-side range. </div><div class="ttdef"><b>Definition:</b> device_memory.h:102</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html">cutlass::device_memory::allocation</a></div><div class="ttdoc">Device allocation abstraction that tracks size and capacity. </div><div class="ttdef"><b>Definition:</b> device_memory.h:120</div></div>
<div class="ttc" id="classcutlass_1_1platform_1_1unique__ptr_html_a7ac06ebe7bc66573d3225891e12d2279"><div class="ttname"><a href="classcutlass_1_1platform_1_1unique__ptr.html#a7ac06ebe7bc66573d3225891e12d2279">cutlass::platform::unique_ptr::release</a></div><div class="ttdeci">pointer release() noexcept</div><div class="ttdoc">Releases ownership of the managed object, if any. </div><div class="ttdef"><b>Definition:</b> platform.h:738</div></div>
<div class="ttc" id="structcutlass_1_1device__memory_1_1allocation_html_a73138c905fb54cfb1556914cb6d106c7"><div class="ttname"><a href="structcutlass_1_1device__memory_1_1allocation.html#a73138c905fb54cfb1556914cb6d106c7">cutlass::device_memory::allocation::allocation</a></div><div class="ttdeci">allocation(allocation const &amp;p)</div><div class="ttdoc">Copy constructor. </div><div class="ttdef"><b>Definition:</b> device_memory.h:154</div></div>
<div class="ttc" id="namespacecutlass_1_1device__memory_html_a8ff6151b081442db9af7421110c0242b"><div class="ttname"><a href="namespacecutlass_1_1device__memory.html#a8ff6151b081442db9af7421110c0242b">cutlass::device_memory::copy_device_to_device</a></div><div class="ttdeci">void copy_device_to_device(T *dst, T const *src, size_t count=1)</div><div class="ttdef"><b>Definition:</b> device_memory.h:91</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>