"docs/vscode:/vscode.git/clone" did not exist on "5a5b0fc39dfdaaf2d6cf75e00e1c4a5a382dd59f"
Commit c663c5b1 authored by rusty1s's avatar rusty1s
Browse files

added comments

parent 763644ec
...@@ -31,13 +31,13 @@ __global__ void weightedProposeKernel(int64_t *color, int64_t *prop, int64_t *ro ...@@ -31,13 +31,13 @@ __global__ void weightedProposeKernel(int64_t *color, int64_t *prop, int64_t *ro
c = col[e]; c = col[e];
tmp = weight[e]; tmp = weight[e];
if (isDead && color[c] < 0) { isDead = false; } // Unmatched neighbor found. if (isDead && color[c] < 0) { isDead = false; } // Unmatched neighbor found.
// Propose to current maximum weighted red neighbor. // Find maximum weighted red neighbor.
if (color[c] == -2 && THCNumerics<T>::gt(tmp, maxWeight)) { if (color[c] == -2 && THCNumerics<T>::gt(tmp, maxWeight)) {
matchedValue = c; matchedValue = c;
maxWeight = tmp; maxWeight = tmp;
} }
} }
prop[i] = matchedValue; prop[i] = matchedValue; // Propose.
if (isDead) { color[i] = i; } // Mark node as dead. if (isDead) { color[i] = i; } // Mark node as dead.
} }
} }
......
...@@ -34,13 +34,13 @@ __global__ void weightedResponseKernel(int64_t *color, int64_t *prop, int64_t *r ...@@ -34,13 +34,13 @@ __global__ void weightedResponseKernel(int64_t *color, int64_t *prop, int64_t *r
c = col[e]; c = col[e];
tmp = weight[e]; tmp = weight[e];
if (isDead && color[c] < 0) { isDead = false; } // Unmatched neighbor found. if (isDead && color[c] < 0) { isDead = false; } // Unmatched neighbor found.
// Match maximum weighted blue neighbor, who proposed to i. // Find maximum weighted blue neighbor, who proposed to i.
if (color[c] == -1 && prop[c] == i && THCNumerics<T>::gt(tmp, maxWeight)) { if (color[c] == -1 && prop[c] == i && THCNumerics<T>::gt(tmp, maxWeight)) {
matchedValue = c; matchedValue = c;
maxWeight = tmp; maxWeight = tmp;
} }
} }
if (matchedValue >= 0) { if (matchedValue >= 0) { // Match neighbors.
color[i] = min(i, matchedValue); color[i] = min(i, matchedValue);
color[matchedValue] = min(i, matchedValue); color[matchedValue] = min(i, matchedValue);
} }
......
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