This commit is contained in:
CircleCI Docs
2025-01-09 21:56:20 +00:00
parent 04b749a588
commit d8d647015b
2642 changed files with 137687 additions and 70861 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="generator" content="Doxygen 1.13.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/io/threadpool.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -11,11 +11,18 @@
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.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">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
@@ -28,12 +35,24 @@
<div id="projectname">MLX
</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
<input type="text" id="MSearchField" value="" placeholder="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.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<!-- Generated by Doxygen 1.13.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
@@ -44,22 +63,23 @@ var searchBox = new SearchBox("searchBox", "search/",'.html');
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
$(function(){initNavTree('threadpool_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
@@ -81,12 +101,6 @@ $(function(){ initResizable(false); });
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_2193406f5b2eae6fc53753d8a9a80df3.html">io</a></li> </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
<div class="headertitle"><div class="title">threadpool.h</div></div>
</div><!--header-->
@@ -126,11 +140,11 @@ $(function(){ initResizable(false); });
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="};">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="class_thread_pool.html"> 35</a></span><span class="keyword">class </span><a class="code hl_class" href="class_thread_pool.html">ThreadPool</a> {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="class_thread_pool.html"> 35</a></span><span class="keyword">class </span><a class="code hl_function" href="class_thread_pool.html#ac291710e33dbbed96ee20711080d506d">ThreadPool</a> {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_function" href="class_thread_pool.html#ac291710e33dbbed96ee20711080d506d">ThreadPool</a>(<span class="keywordtype">size_t</span>);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">template</span> &lt;<span class="keyword">class </span>F, <span class="keyword">class</span>... Args&gt;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">auto</span> <a class="code hl_function" href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196">enqueue</a>(F&amp;&amp; <a class="code hl_variable" href="types_2bf16_8h.html#af900396d7b72ff2a7002e8befe8cf8f1">f</a>, Args&amp;&amp;... args)</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">auto</span> <a class="code hl_function" href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196">enqueue</a>(F&amp;&amp; f, Args&amp;&amp;... args)</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> -&gt; std::future&lt;<span class="keyword">typename</span> std::invoke_result_t&lt;F, Args...&gt;&gt;;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_function" href="class_thread_pool.html#a44d3d2ab618970605e684efc216655eb">~ThreadPool</a>();</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
@@ -168,12 +182,12 @@ $(function(){ initResizable(false); });
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="keyword">template</span> &lt;<span class="keyword">class </span>F, <span class="keyword">class</span>... Args&gt;</div>
<div class="foldopen" id="foldopen00073" data-start="{" data-end="}">
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196"> 73</a></span><span class="keyword">auto</span> <a class="code hl_function" href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196">ThreadPool::enqueue</a>(F&amp;&amp; <a class="code hl_variable" href="types_2bf16_8h.html#af900396d7b72ff2a7002e8befe8cf8f1">f</a>, Args&amp;&amp;... args)</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196"> 73</a></span><span class="keyword">auto</span> <a class="code hl_function" href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196">ThreadPool::enqueue</a>(F&amp;&amp; f, Args&amp;&amp;... args)</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> -&gt; std::future&lt;<span class="keyword">typename</span> std::invoke_result_t&lt;F, Args...&gt;&gt; {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">using </span>return_type = <span class="keyword">typename</span> std::invoke_result_t&lt;F, Args...&gt;;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keyword">auto</span> task = std::make_shared&lt;std::packaged_task&lt;return_type()&gt;&gt;(</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::bind(std::forward&lt;F&gt;(<a class="code hl_variable" href="types_2bf16_8h.html#af900396d7b72ff2a7002e8befe8cf8f1">f</a>), std::forward&lt;Args&gt;(args)...));</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::bind(std::forward&lt;F&gt;(f), std::forward&lt;Args&gt;(args)...));</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::future&lt;return_type&gt; res = task-&gt;get_future();</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> {</div>
@@ -202,16 +216,17 @@ $(function(){ initResizable(false); });
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> worker.join();</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span>}</div>
</div>
<div class="ttc" id="aclass_thread_pool_html"><div class="ttname"><a href="class_thread_pool.html">ThreadPool</a></div><div class="ttdef"><b>Definition</b> threadpool.h:35</div></div>
<div class="ttc" id="aclass_thread_pool_html_a375fa2d63197282277be640b54e8a196"><div class="ttname"><a href="class_thread_pool.html#a375fa2d63197282277be640b54e8a196">ThreadPool::enqueue</a></div><div class="ttdeci">auto enqueue(F &amp;&amp;f, Args &amp;&amp;... args) -&gt; std::future&lt; typename std::invoke_result_t&lt; F, Args... &gt; &gt;</div><div class="ttdef"><b>Definition</b> threadpool.h:73</div></div>
<div class="ttc" id="aclass_thread_pool_html_a44d3d2ab618970605e684efc216655eb"><div class="ttname"><a href="class_thread_pool.html#a44d3d2ab618970605e684efc216655eb">ThreadPool::~ThreadPool</a></div><div class="ttdeci">~ThreadPool()</div><div class="ttdef"><b>Definition</b> threadpool.h:95</div></div>
<div class="ttc" id="aclass_thread_pool_html_ac291710e33dbbed96ee20711080d506d"><div class="ttname"><a href="class_thread_pool.html#ac291710e33dbbed96ee20711080d506d">ThreadPool::ThreadPool</a></div><div class="ttdeci">ThreadPool(size_t)</div><div class="ttdef"><b>Definition</b> threadpool.h:51</div></div>
<div class="ttc" id="atypes_2bf16_8h_html_af900396d7b72ff2a7002e8befe8cf8f1"><div class="ttname"><a href="types_2bf16_8h.html#af900396d7b72ff2a7002e8befe8cf8f1">f</a></div><div class="ttdeci">float f</div><div class="ttdef"><b>Definition</b> bf16.h:16</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_2193406f5b2eae6fc53753d8a9a80df3.html">io</a></li><li class="navelem"><a class="el" href="threadpool_8h.html">threadpool.h</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.1 </li>
</ul>
</div>
</body>
</html>