Commit 29b354e0 authored by Paul's avatar Paul
Browse files

Add more documentation

parent 6eb13d95
......@@ -5,9 +5,12 @@ set(DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen/)
add_doxygen_doc(
OUTPUT_DIRECTORY ${DOXYGEN_OUTPUT}
INPUT
${CMAKE_CURRENT_SOURCE_DIR}/../include
${CMAKE_CURRENT_SOURCE_DIR}/../src
${CMAKE_CURRENT_SOURCE_DIR}/../onnx
INCLUDE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/../src/include
${CMAKE_CURRENT_SOURCE_DIR}/../src/targets/cpu/include
${CMAKE_CURRENT_SOURCE_DIR}/../src/targets/gpu/include
SEARCH_INCLUDES YES
MACRO_EXPANSION YES
RECURSIVE YES
GENERATE_XML YES
......@@ -28,6 +31,10 @@ add_doxygen_doc(
FULL_PATH_NAMES YES
PREDEFINED DOXYGEN
)
add_custom_target(remove_inline_ns
sed -i "s/MIGRAPH_INLINE_NS:://g" *.xml
WORKING_DIRECTORY ${DOXYGEN_OUTPUT}/xml)
add_dependencies(remove_inline_ns doxygen)
include(SphinxDoc)
add_sphinx_doc(src
......@@ -36,7 +43,7 @@ add_sphinx_doc(src
VARS
breathe_projects.proj=${DOXYGEN_OUTPUT}/xml
breathe_default_project=proj
DEPENDS doxygen
DEPENDS doxygen remove_inline_ns
)
find_package(LATEX)
......
......@@ -21,7 +21,7 @@ raw_data
.. doxygenstruct:: migraph::raw_data
.. doxygenfunction:: migraph::visit_all
.. doxygenfunction:: migraph::MIGRAPH_INLINE_NS::visit_all
tensor_view
......
......@@ -11,12 +11,37 @@ dead_code_elimination
.. doxygenstruct:: migraph::dead_code_elimination
auto_contiguous
---------------
common_subexpression_elimination
--------------------------------
.. doxygenstruct:: migraph::gpu::auto_contiguous
.. doxygenstruct:: migraph::common_subexpression_elimination
write_literals
--------------
constant_propagate
------------------
.. doxygenstruct:: migraph::gpu::write_literals
.. doxygenstruct:: migraph::constant_propagate
eliminate_concat
----------------
.. doxygenstruct:: migraph::eliminate_concat
eliminate_contiguous
--------------------
.. doxygenstruct:: migraph::eliminate_contiguous
fwd_conv_batchnorm_rewrite
--------------------------
.. doxygenstruct:: migraph::fwd_conv_batchnorm_rewrite
simplify_algebra
----------------
.. doxygenstruct:: migraph::simplify_algebra
simplify_reshapes
-----------------
.. doxygenstruct:: migraph::simplify_reshapes
......@@ -21,4 +21,4 @@ program
parse_onnx
----------
.. doxygenfunction:: migraph::parse_onnx
.. doxygenfunction:: migraph::MIGRAPH_INLINE_NS::parse_onnx
......@@ -10,6 +10,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Remove identical instructions.
*/
struct common_subexpression_elimination
{
std::string name() const { return "common_subexpression_elimination"; }
......
......@@ -3,7 +3,7 @@
namespace migraph {
#ifndef MIGRAPH_USE_CLANG_TIDY
#if !defined(MIGRAPH_USE_CLANG_TIDY) && !defined(DOXYGEN)
#define MIGRAPH_INLINE_NS version_1
#endif
......
......@@ -9,6 +9,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Replace instructions which take all literals with a literal of the computation.
*/
struct constant_propagate
{
std::string name() const { return "constant_propagate"; }
......
......@@ -10,6 +10,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Remove instructions where the output is not used.
*/
struct dead_code_elimination
{
std::string name() const { return "dead_code_elimination"; }
......
......@@ -10,6 +10,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Remove memory allocations. This will create a parameter which is the max of all memory used in the program.
*/
struct eliminate_allocation
{
std::string allocation_op{};
......
......@@ -11,6 +11,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Remove concat operators by having each operator can write to different chunk of memory.
*/
struct eliminate_concat
{
concat_optimization concat_opt;
......
......@@ -10,6 +10,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Remove contiguous instructions by checking if the operator can use non-standard shapes.
*/
struct eliminate_contiguous
{
std::string name() const { return "eliminate_contiguous"; }
......
......@@ -10,6 +10,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Rewrite batchnorm to a multiply and add.
*/
struct fwd_conv_batchnorm_rewrite
{
std::string name() const { return "fwd_conv_batchnorm_rewrite"; }
......
......@@ -9,6 +9,9 @@ namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Remove memory allocations. It uses graph coloring to find memory allocations that can be reused.
*/
struct memory_coloring
{
std::string allocation_op{};
......
......@@ -9,6 +9,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Simplify many algebraic instructions to more efficient versions.
*/
struct simplify_algebra
{
std::string name() const { return "simplify_algebra"; }
......
......@@ -10,6 +10,9 @@ inline namespace MIGRAPH_INLINE_NS {
struct program;
/**
* Eliminate redundant reshapes.
*/
struct simplify_reshapes
{
std::string name() const { return "simplify_reshapes"; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment