@@ -13,18 +13,18 @@ Although limited, this functionality is sufficient to support analysis of many
13
13
HPC codes, and CBI has been tested on C, C++, CUDA and some Fortran code bases.
14
14
15
15
16
- Computing Code Divergence
17
- #########################
16
+ Computing Specialization Metrics
17
+ ################################
18
18
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:
21
21
22
22
.. image :: specialization-tree.png
23
23
:alt: An example of a specialization tree.
24
24
25
25
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.
28
28
29
29
.. code :: text
30
30
@@ -46,9 +46,7 @@ are shared between different platform sets.
46
46
Avg. Coverage (%): 42.44
47
47
Total SLOC: 41
48
48
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 >`.
52
50
53
51
54
52
Hierarchical Clustering
@@ -76,3 +74,28 @@ hierarchical clustering by platform similarity.
76
74
77
75
.. image :: example-dendrogram.png
78
76
: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