Skip to content

Commit af62c0a

Browse files
committed
Update list of key features in the documentation
Divergence is no longer the only metric calculated by CBI, and we can now measure and visualize platform coverage. Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent 93fae48 commit af62c0a

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

docs/source/features.rst

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ Although limited, this functionality is sufficient to support analysis of many
1313
HPC codes, and CBI has been tested on C, C++, CUDA and some Fortran code bases.
1414

1515

16-
Computing Code Divergence
17-
#########################
16+
Computing Specialization Metrics
17+
################################
1818

19-
CBI computes code divergence by building a *specialization tree*, like the one
20-
shown below:
19+
CBI computes code divergence and platform coverage by building a
20+
*specialization tree*, like the one shown below:
2121

2222
.. image:: specialization-tree.png
2323
:alt: An example of a specialization tree.
2424

2525
CBI can then walk and evaluate this tree for different platform definitions, to
26-
produce a divergence report providing a breakdown of how many lines of code
27-
are shared between different platform sets.
26+
produce a report providing a breakdown of how many lines of code are shared
27+
between different platform sets.
2828

2929
.. code:: text
3030
@@ -46,9 +46,7 @@ are shared between different platform sets.
4646
Avg. Coverage (%): 42.44
4747
Total SLOC: 41
4848
49-
Future releases of CBI will provide additional ways to visualize the results of
50-
this analysis, in order to highlight exactly *which* lines of code correspond
51-
to different platform sets.
49+
For more information about these metrics, see :doc:`here <specialization>`.
5250

5351

5452
Hierarchical Clustering
@@ -76,3 +74,28 @@ hierarchical clustering by platform similarity.
7674

7775
.. image:: example-dendrogram.png
7876
:alt: A dendrogram representing the distance between platforms.
77+
78+
79+
Visualizing Platform Coverage
80+
#############################
81+
82+
To assist developers in identifying exactly which parts of their code are
83+
specialized and for which platforms, CBI can produce an annotated tree showing
84+
the amount of specialization within each file.
85+
86+
.. code:: text
87+
88+
Legend:
89+
A: cpu
90+
B: gpu
91+
92+
Columns:
93+
[Platforms | SLOC | Coverage (%) | Avg. Coverage (%)]
94+
95+
[AB | 1.0k | 2.59 | 1.83] o /path/to/sample-code-base/src/
96+
[-- | 1.0k | 0.00 | 0.00] |-- unused.cpp
97+
[AB | 13 | 100.00 | 92.31] |-- main.cpp
98+
[A- | 7 | 100.00 | 50.00] |-o cpu/
99+
[A- | 7 | 100.00 | 50.00] | \-- foo.cpp
100+
[-B | 7 | 100.00 | 50.00] \-o gpu/
101+
[-B | 7 | 100.00 | 50.00] \-- foo.cpp

0 commit comments

Comments
 (0)