blob: 48826045c626199a8a84bb81ad77e6d375e318e2 [file] [log] [blame]
<!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>mxnet: /work/mxnet/3rdparty/dmlc-core/include/dmlc/registry.h File Reference</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>
<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.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_8cab8f464681f7cc51cee77e79a434cd.html">3rdparty</a></li><li class="navelem"><a class="el" href="dir_82e31a22178767beedddc7597fd1ecb6.html">dmlc-core</a></li><li class="navelem"><a class="el" href="dir_7dd5b88db83ff474628c03c453739a90.html">include</a></li><li class="navelem"><a class="el" href="dir_e30967e3ab51f65ad4b50dd298ccf4e7.html">dmlc</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a> </div>
<div class="headertitle">
<div class="title">registry.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;map&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &quot;<a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2base_8h_source.html">./base.h</a>&quot;</code><br />
<code>#include &quot;./logging.h&quot;</code><br />
<code>#include &quot;<a class="el" href="parameter_8h_source.html">./parameter.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="type__traits_8h_source.html">./type_traits.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for registry.h:</div>
<div class="dyncontent">
<div class="center"><img src="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h__incl.png" border="0" usemap="#_2work_2mxnet_23rdparty_2dmlc-core_2include_2dmlc_2registry_8h" alt=""/></div>
<map name="_2work_2mxnet_23rdparty_2dmlc-core_2include_2dmlc_2registry_8h" id="_2work_2mxnet_23rdparty_2dmlc-core_2include_2dmlc_2registry_8h">
<area shape="rect" id="node5" href="3rdparty_2dmlc-core_2include_2dmlc_2base_8h.html" title="./base.h" alt="" coords="1247,333,1321,360"/>
<area shape="rect" id="node10" href="parameter_8h.html" title="Provide lightweight util to do parameter setup and checking. " alt="" coords="1247,109,1356,136"/>
<area shape="rect" id="node27" href="type__traits_8h.html" title="type traits information header " alt="" coords="1035,259,1146,285"/>
<area shape="rect" id="node8" href="build__config__default_8h.html" title="Default detection logic for fopen64 and other symbols. May be overriden by CMake. ..." alt="" coords="1187,408,1381,435"/>
<area shape="rect" id="node24" href="json_8h.html" title="Lightweight JSON Reader/Writer that read save into C++ data structs. This includes STL composites and..." alt="" coords="1145,184,1213,211"/>
<area shape="rect" id="node31" href="optional_8h.html" title="Container to hold optional data. " alt="" coords="555,184,648,211"/>
<area shape="rect" id="node34" href="strtonum_8h.html" title="A faster implementation of strtof and strtod. " alt="" coords="1732,259,1833,285"/>
<area shape="rect" id="node32" href="common_8h.html" title="defines some common utility function. " alt="" coords="499,259,597,285"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h__dep__incl.png" border="0" usemap="#_2work_2mxnet_23rdparty_2dmlc-core_2include_2dmlc_2registry_8hdep" alt=""/></div>
<map name="_2work_2mxnet_23rdparty_2dmlc-core_2include_2dmlc_2registry_8hdep" id="_2work_2mxnet_23rdparty_2dmlc-core_2include_2dmlc_2registry_8hdep">
<area shape="rect" id="node2" href="data_8h.html" title="defines common input data structure, and interface for handling the input data " alt="" coords="56,109,231,165"/>
<area shape="rect" id="node4" href="include_2mxnet_2io_8h.html" title="/work/mxnet/include\l/mxnet/io.h" alt="" coords="194,1113,343,1154"/>
<area shape="rect" id="node5" href="include_2mxnet_2ndarray_8h.html" title="/work/mxnet/include\l/mxnet/ndarray.h" alt="" coords="649,1016,798,1057"/>
<area shape="rect" id="node11" href="include_2mxnet_2operator_8h.html" title="/work/mxnet/include\l/mxnet/operator.h" alt="" coords="1483,1209,1633,1251"/>
<area shape="rect" id="node12" href="operator__util_8h.html" title="Utility functions and registries to help quickly build new operators. [Deprecated] Use the register f..." alt="" coords="1953,1299,2117,1340"/>
<area shape="rect" id="node18" href="3rdparty_2tvm_2nnvm_2include_2nnvm_2base_8h.html" title="Configuration of nnvm as well as basic data structure. " alt="" coords="1213,109,1393,165"/>
<area shape="rect" id="node3" href="threadediter_8h.html" title="thread backed iterator that can be used to implement general thread&#45;based pipeline such as prefetch a..." alt="" coords="5,213,180,269"/>
<area shape="rect" id="node6" href="packed__func_8h.html" title="Type&#45;erased function used across MXNET API. " alt="" coords="425,1105,595,1161"/>
<area shape="rect" id="node9" href="include_2mxnet_2executor_8h.html" title="/work/mxnet/include\l/mxnet/executor.h" alt="" coords="626,1299,775,1340"/>
<area shape="rect" id="node10" href="include_2mxnet_2op__attr__types_8h.html" title="/work/mxnet/include\l/mxnet/op_attr_types.h" alt="" coords="1299,1113,1470,1154"/>
<area shape="rect" id="node14" href="imperative_8h.html" title="/work/mxnet/include\l/mxnet/imperative.h" alt="" coords="1708,1299,1859,1340"/>
<area shape="rect" id="node15" href="utils_8h.html" title="Basic utilility functions. " alt="" coords="1463,1388,1647,1429"/>
<area shape="rect" id="node17" href="include_2mxnet_2kvstore_8h.html" title="/work/mxnet/include\l/mxnet/kvstore.h" alt="" coords="738,1113,887,1154"/>
<area shape="rect" id="node7" href="include_2mxnet_2runtime_2registry_8h.html" title="/work/mxnet/include\l/mxnet/runtime/registry.h" alt="" coords="419,1209,601,1251"/>
<area shape="rect" id="node8" href="api__registry_8h.html" title="This file contains utilities related to the MXNet&#39;s global function registry. " alt="" coords="433,1299,587,1340"/>
<area shape="rect" id="node13" href="include_2mxnet_2graph__attr__types_8h.html" title="/work/mxnet/include\l/mxnet/graph_attr_types.h" alt="" coords="1166,1209,1358,1251"/>
<area shape="rect" id="node16" href="exec__utils_8h.html" title="Common utility functions for executors. " alt="" coords="1463,1477,1647,1519"/>
<area shape="rect" id="node19" href="graph_8h.html" title="Configuation of nnvm as well as basic data structure. " alt="" coords="1856,525,2036,581"/>
<area shape="rect" id="node28" href="pass_8h.html" title="Pass that can be applied to a graph. " alt="" coords="1005,629,1185,685"/>
<area shape="rect" id="node29" href="pass__functions_8h.html" title="Pass functions that simply redirect the calls to ApplyPass. " alt="" coords="560,733,740,789"/>
<area shape="rect" id="node30" href="3rdparty_2tvm_2nnvm_2include_2nnvm_2node_8h.html" title="Graph node data structure. " alt="" coords="1633,317,1813,373"/>
<area shape="rect" id="node31" href="symbolic_8h.html" title="Symbolic graph construction API. " alt="" coords="1817,421,1997,477"/>
<area shape="rect" id="node32" href="3rdparty_2tvm_2nnvm_2include_2nnvm_2op__attr__types_8h.html" title="Data structures that can appear in operator attributes. " alt="" coords="1213,629,1393,685"/>
<area shape="rect" id="node33" href="op_8h.html" title="Operator information structor. " alt="" coords="1399,221,1611,262"/>
<area shape="rect" id="node34" href="3rdparty_2tvm_2nnvm_2include_2nnvm_2tuple_8h.html" title="Data structure Tuple and TShape to store dynamic sized shapes. " alt="" coords="1035,525,1215,581"/>
<area shape="rect" id="node20" href="include_2mxnet_2tuple_8h.html" title="Data structure Tuple and TShape to store dynamic sized shapes. " alt="" coords="1063,741,1213,782"/>
<area shape="rect" id="node21" href="include_2mxnet_2base_8h.html" title="/work/mxnet/include\l/mxnet/base.h" alt="" coords="1063,837,1213,879"/>
<area shape="rect" id="node22" href="engine_8h.html" title="Engine that schedules all the operations according to dependency. " alt="" coords="1570,927,1719,968"/>
<area shape="rect" id="node23" href="resource_8h.html" title="Global resource allocation handling. " alt="" coords="1433,1016,1582,1057"/>
<area shape="rect" id="node24" href="storage_8h.html" title="Storage manager across multiple devices. " alt="" coords="661,927,810,968"/>
<area shape="rect" id="node25" href="random__generator_8h.html" title="Parallel random number generator. " alt="" coords="1293,927,1495,968"/>
<area shape="rect" id="node26" href="rtc_8h.html" title="/work/mxnet/include\l/mxnet/rtc.h" alt="" coords="885,927,1034,968"/>
<area shape="rect" id="node27" href="tensor__blob_8h.html" title="TBlob class that holds common representation of arbirary dimension tensor, can be used to transformed..." alt="" coords="1059,927,1217,968"/>
<area shape="rect" id="node35" href="3rdparty_2tvm_2nnvm_2include_2nnvm_2graph__attr__types_8h.html" title="Data structures that can appear in graph attributes. " alt="" coords="723,629,903,685"/>
</map>
</div>
</div>
<p><a href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdmlc_1_1Registry.html">dmlc::Registry&lt; EntryType &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classdmlc_1_1Registry.html" title="Registry class. Registry can be used to register global singletons. The most commonly use case are fa...">Registry</a> class. <a class="el" href="classdmlc_1_1Registry.html" title="Registry class. Registry can be used to register global singletons. The most commonly use case are fa...">Registry</a> can be used to register global singletons. The most commonly use case are factory functions. <a href="classdmlc_1_1Registry.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdmlc_1_1FunctionRegEntryBase.html">dmlc::FunctionRegEntryBase&lt; EntryType, FunctionType &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Common base class for function registry. <a href="classdmlc_1_1FunctionRegEntryBase.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacedmlc"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedmlc.html">dmlc</a></td></tr>
<tr class="memdesc:namespacedmlc"><td class="mdescLeft">&#160;</td><td class="mdescRight">namespace for dmlc <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a30edfc9f7bcb9862348b512dd73354ff"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a30edfc9f7bcb9862348b512dd73354ff">DMLC_REGISTRY_ENABLE</a>(EntryType)</td></tr>
<tr class="memdesc:a30edfc9f7bcb9862348b512dd73354ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Macro to enable the registry of EntryType. This macro must be used under namespace dmlc, and only used once in cc file. <a href="#a30edfc9f7bcb9862348b512dd73354ff">More...</a><br /></td></tr>
<tr class="separator:a30edfc9f7bcb9862348b512dd73354ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6870c3bce5b56d427a4d225b1194816"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#af6870c3bce5b56d427a4d225b1194816">DMLC_REGISTRY_REGISTER</a>(EntryType, EntryTypeName, Name)</td></tr>
<tr class="memdesc:af6870c3bce5b56d427a4d225b1194816"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic macro to register an EntryType There is a complete example in FactoryRegistryEntryBase. <a href="#af6870c3bce5b56d427a4d225b1194816">More...</a><br /></td></tr>
<tr class="separator:af6870c3bce5b56d427a4d225b1194816"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4948c95b9237182a8c10fb02bb3e9dc2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a4948c95b9237182a8c10fb02bb3e9dc2">DMLC_REGISTRY_FILE_TAG</a>(UniqueTag)&#160;&#160;&#160;int __dmlc_registry_file_tag_ ## UniqueTag ## __() { return 0; }</td></tr>
<tr class="memdesc:a4948c95b9237182a8c10fb02bb3e9dc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">(Optional) Declare a file tag to current file that contains object registrations. <a href="#a4948c95b9237182a8c10fb02bb3e9dc2">More...</a><br /></td></tr>
<tr class="separator:a4948c95b9237182a8c10fb02bb3e9dc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b08353ab775fb48862638173cf1ce38"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a7b08353ab775fb48862638173cf1ce38">DMLC_REGISTRY_LINK_TAG</a>(UniqueTag)</td></tr>
<tr class="memdesc:a7b08353ab775fb48862638173cf1ce38"><td class="mdescLeft">&#160;</td><td class="mdescRight">(Optional) Force link to all the objects registered in file tag. <a href="#a7b08353ab775fb48862638173cf1ce38">More...</a><br /></td></tr>
<tr class="separator:a7b08353ab775fb48862638173cf1ce38"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a30edfc9f7bcb9862348b512dd73354ff"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DMLC_REGISTRY_ENABLE</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">EntryType</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keyword">template</span>&lt;&gt; \</div><div class="line"> Registry&lt;EntryType &gt; *<a class="code" href="classRegistry.html">Registry&lt;EntryType &gt;::Get</a>() { \</div><div class="line"> static <a class="code" href="classRegistry.html">Registry&lt;EntryType &gt;</a> inst; \</div><div class="line"> return &amp;inst; \</div><div class="line"> } \</div><div class="ttc" id="classRegistry_html"><div class="ttname"><a href="classRegistry.html">Registry</a></div><div class="ttdoc">Registry class to registers things (ops, properties) Singleton class. </div><div class="ttdef"><b>Definition:</b> lib_api.h:1099</div></div>
</div><!-- fragment -->
<p>Macro to enable the registry of EntryType. This macro must be used under namespace dmlc, and only used once in cc file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">EntryType</td><td>Type of registry entry </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a4948c95b9237182a8c10fb02bb3e9dc2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DMLC_REGISTRY_FILE_TAG</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">UniqueTag</td><td>)</td>
<td>&#160;&#160;&#160;int __dmlc_registry_file_tag_ ## UniqueTag ## __() { return 0; }</td>
</tr>
</table>
</div><div class="memdoc">
<p>(Optional) Declare a file tag to current file that contains object registrations. </p>
<p>This will declare a dummy function that will be called by register file to incur a link dependency.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">UniqueTag</td><td>The unique tag used to represent. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a7b08353ab775fb48862638173cf1ce38" title="(Optional) Force link to all the objects registered in file tag. ">DMLC_REGISTRY_LINK_TAG</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a7b08353ab775fb48862638173cf1ce38"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DMLC_REGISTRY_LINK_TAG</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">UniqueTag</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordtype">int</span> __dmlc_registry_file_tag_ ## UniqueTag ## __(); \</div><div class="line"> static <span class="keywordtype">int</span> <a class="code" href="3rdparty_2dmlc-core_2include_2dmlc_2base_8h.html#a9425a87a06019a8392509217b2a1da5a">DMLC_ATTRIBUTE_UNUSED</a> __reg_file_tag_ ## UniqueTag ## __ = \</div><div class="line"> __dmlc_registry_file_tag_ ## UniqueTag ## __();</div><div class="ttc" id="3rdparty_2dmlc-core_2include_2dmlc_2base_8h_html_a9425a87a06019a8392509217b2a1da5a"><div class="ttname"><a href="3rdparty_2dmlc-core_2include_2dmlc_2base_8h.html#a9425a87a06019a8392509217b2a1da5a">DMLC_ATTRIBUTE_UNUSED</a></div><div class="ttdeci">#define DMLC_ATTRIBUTE_UNUSED</div><div class="ttdoc">helper macro to supress unused warning </div><div class="ttdef"><b>Definition:</b> base.h:148</div></div>
</div><!-- fragment -->
<p>(Optional) Force link to all the objects registered in file tag. </p>
<p>This macro must be used in the same file as DMLC_REGISTRY_ENABLE and in the same namespace as DMLC_REGISTRY_FILE_TAG</p>
<p>DMLC_REGISTRY_FILE_TAG and DMLC_REGISTRY_LINK_TAG are optional macros for registration. They are used to encforce link of certain file into during static linking.</p>
<p>This is mainly used to solve problem during statically link a library which contains backward registration. Specifically, this avoids the objects in these file tags to be ignored by compiler.</p>
<p>For dynamic linking, this problem won't occur as everything is loaded by default.</p>
<p>Use of this is optional as it will create an error when a file tag do not exist. An alternative solution is always ask user to enable &ndash;whole-archieve during static link.</p>
<p>// in file objective_registry.cc <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a30edfc9f7bcb9862348b512dd73354ff" title="Macro to enable the registry of EntryType. This macro must be used under namespace dmlc...">DMLC_REGISTRY_ENABLE(MyObjective)</a>; <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a7b08353ab775fb48862638173cf1ce38" title="(Optional) Force link to all the objects registered in file tag. ">DMLC_REGISTRY_LINK_TAG(regression_op)</a>; <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a7b08353ab775fb48862638173cf1ce38" title="(Optional) Force link to all the objects registered in file tag. ">DMLC_REGISTRY_LINK_TAG(rank_op)</a>;</p>
<p>// in file regression_op.cc // declare tag of this file. <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a4948c95b9237182a8c10fb02bb3e9dc2" title="(Optional) Declare a file tag to current file that contains object registrations. ...">DMLC_REGISTRY_FILE_TAG(regression_op)</a>; <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#af6870c3bce5b56d427a4d225b1194816" title="Generic macro to register an EntryType There is a complete example in FactoryRegistryEntryBase. ">DMLC_REGISTRY_REGISTER(MyObjective, logistic_reg, logistic_reg)</a>; // ...</p>
<p>// in file rank_op.cc // declare tag of this file. <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a4948c95b9237182a8c10fb02bb3e9dc2" title="(Optional) Declare a file tag to current file that contains object registrations. ...">DMLC_REGISTRY_FILE_TAG(rank_op)</a>; <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#af6870c3bce5b56d427a4d225b1194816" title="Generic macro to register an EntryType There is a complete example in FactoryRegistryEntryBase. ">DMLC_REGISTRY_REGISTER(MyObjective, pairwiserank, pairwiserank)</a>;</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">UniqueTag</td><td>The unique tag used to represent. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a30edfc9f7bcb9862348b512dd73354ff" title="Macro to enable the registry of EntryType. This macro must be used under namespace dmlc...">DMLC_REGISTRY_ENABLE</a>, <a class="el" href="3rdparty_2dmlc-core_2include_2dmlc_2registry_8h.html#a4948c95b9237182a8c10fb02bb3e9dc2" title="(Optional) Declare a file tag to current file that contains object registrations. ...">DMLC_REGISTRY_FILE_TAG</a> </dd></dl>
</div>
</div>
<a class="anchor" id="af6870c3bce5b56d427a4d225b1194816"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DMLC_REGISTRY_REGISTER</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">EntryType, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">EntryTypeName, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">Name&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keyword">static</span> <a class="code" href="3rdparty_2dmlc-core_2include_2dmlc_2base_8h.html#a9425a87a06019a8392509217b2a1da5a">DMLC_ATTRIBUTE_UNUSED</a> EntryType &amp; __make_ ## EntryTypeName ## _ ## Name ## __ = <a class="code" href="classdmlc_1_1Registry.html#ae41428f0ae40e5545df63a2dd0af50d6">\</a></div><div class="line"><a class="code" href="classdmlc_1_1Registry.html#ae41428f0ae40e5545df63a2dd0af50d6"> ::dmlc::Registry&lt;EntryType&gt;::Get</a>()-&gt;<a class="code" href="classdmlc_1_1Registry.html#a0b71def33966eca79ad304b9da04fecc">__REGISTER__</a>(#Name) \</div><div class="ttc" id="3rdparty_2dmlc-core_2include_2dmlc_2base_8h_html_a9425a87a06019a8392509217b2a1da5a"><div class="ttname"><a href="3rdparty_2dmlc-core_2include_2dmlc_2base_8h.html#a9425a87a06019a8392509217b2a1da5a">DMLC_ATTRIBUTE_UNUSED</a></div><div class="ttdeci">#define DMLC_ATTRIBUTE_UNUSED</div><div class="ttdoc">helper macro to supress unused warning </div><div class="ttdef"><b>Definition:</b> base.h:148</div></div>
<div class="ttc" id="classdmlc_1_1Registry_html_ae41428f0ae40e5545df63a2dd0af50d6"><div class="ttname"><a href="classdmlc_1_1Registry.html#ae41428f0ae40e5545df63a2dd0af50d6">dmlc::Registry::Get</a></div><div class="ttdeci">static Registry * Get()</div><div class="ttdoc">get a singleton of the Registry. This function can be defined by DMLC_REGISTRY_ENABLE. </div></div>
<div class="ttc" id="classdmlc_1_1Registry_html_a0b71def33966eca79ad304b9da04fecc"><div class="ttname"><a href="classdmlc_1_1Registry.html#a0b71def33966eca79ad304b9da04fecc">dmlc::Registry::__REGISTER__</a></div><div class="ttdeci">EntryType &amp; __REGISTER__(const std::string &amp;name)</div><div class="ttdoc">Internal function to register a name function under name. </div><div class="ttdef"><b>Definition:</b> registry.h:78</div></div>
</div><!-- fragment -->
<p>Generic macro to register an EntryType There is a complete example in FactoryRegistryEntryBase. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">EntryType</td><td>The type of registry entry. </td></tr>
<tr><td class="paramname">EntryTypeName</td><td>The typename of EntryType, must do not contain namespace :: . </td></tr>
<tr><td class="paramname">Name</td><td>The name to be registered. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd>FactoryRegistryEntryBase </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 11 2020 03:38:04 for mxnet 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>