Skip to content

Commit 03804fe

Browse files
updated kmeans doc
1 parent 662867f commit 03804fe

7 files changed

Lines changed: 14 additions & 11 deletions

File tree

docs/Examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
<div class="contents">
105105
<div class="textblock"><p>This page contains several examples to learn Cpp-Taskflow in real use case.</p>
106106
<p><a class="el" href="matrix_multiplication.html">Matrix Multiplication</a> <br />
107-
<a class="el" href="kmeans.html">k-means clustering</a> <br />
107+
<a class="el" href="kmeans.html">k-means Clustering</a> <br />
108108
</p>
109109
</div></div><!-- contents -->
110110
</div><!-- doc-content -->

docs/Examples.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var Examples =
66
[ "GPU-based Acceleration", "matrix_multiplication.html#GPUAcceleratedMatrixMultiplication", null ],
77
[ "Benchmarking", "matrix_multiplication.html#MatrixMultiplicationBenchmarking", null ]
88
] ],
9-
[ "k-means clustering", "kmeans.html", [
9+
[ "k-means Clustering", "kmeans.html", [
1010
[ "Problem Formulation", "kmeans.html#KMeansProblemFormulation", null ],
1111
[ "Parallel k-means using CPUs", "kmeans.html#ParallelKMeansUsingCPUs", null ],
1212
[ "Parallel k-means using GPUs", "kmeans.html#ParallelKMeansUsingGPUs", null ],

docs/kmeans.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

docs/pages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<tr id="row_1_6_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="chapter6.html" target="_self">C6: CPU-GPU Tasking</a></td><td class="desc"></td></tr>
123123
<tr id="row_2_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_2_" class="arrow" onclick="toggleFolder('2_')">&#9660;</span><a class="el" href="Examples.html" target="_self">Learning from Examples</a></td><td class="desc"></td></tr>
124124
<tr id="row_2_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="matrix_multiplication.html" target="_self">Matrix Multiplication</a></td><td class="desc"></td></tr>
125-
<tr id="row_2_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="kmeans.html" target="_self">k-means clustering</a></td><td class="desc"></td></tr>
125+
<tr id="row_2_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="kmeans.html" target="_self">k-means Clustering</a></td><td class="desc"></td></tr>
126126
<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="FAQ.html" target="_self">Frequently Asked Questions</a></td><td class="desc"></td></tr>
127127
<tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Reference.html" target="_self">Reference</a></td><td class="desc"></td></tr>
128128
</table>

docs/search/all_a.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/search/pages_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var searchData=
22
[
3-
['k_2dmeans_20clustering',['k-means clustering',['../kmeans.html',1,'Examples']]]
3+
['k_2dmeans_20clustering',['k-means Clustering',['../kmeans.html',1,'Examples']]]
44
];

doxygen/examples/kmeans.dox

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace tf {
22

3-
/** @page kmeans k-means clustering
3+
/** @page kmeans k-means Clustering
44

55
We study a fundamental clustering problem in unsupervised learning, <em>k-means clustering</em>.
66
We will begin by discussing the problem formulation and then learn how to
@@ -293,7 +293,7 @@ __global__ void compute_new_means(float* mx, float* my, float* sx, float* sy, in
293293
@endcode
294294

295295
When we recompute the cluster centroids to be the mean of all points assigned to a particular centroid,
296-
multiple GPU threads may access the sum arrays, @c sx and @c sy, and the count array, @c.
296+
multiple GPU threads may access the sum arrays, @c sx and @c sy, and the count array, @c c.
297297
To avoid data race, we use a simple @c atomicAdd method.
298298
Based on the two kernels, the entire code of CPU-GPU collaborative tasking is described as follows:
299299

@@ -402,7 +402,10 @@ void kmeans_gpu(int N, int K, int M, cconst std::vector<float>& px, const std::
402402
}
403403
@endcode
404404

405-
The first dump before executing the taskflow produces the following diagram:
405+
The first dump before executing the taskflow produces the following diagram.
406+
The condition tasks introduces a cycle between itself and @c update_means.
407+
Each time it goes back to @c update_means, the %cudaFlow is reconstructed with captured
408+
parameters in the closure and offloaded to the GPU.
406409

407410
@image html images/kmeans_3.svg width=80%
408411

0 commit comments

Comments
 (0)