Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-cluster
Commits
11726e3d
Commit
11726e3d
authored
Apr 07, 2018
by
rusty1s
Browse files
bugfix
parent
68ed8ead
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
aten/THC/THCPropose.cuh
aten/THC/THCPropose.cuh
+3
-6
aten/THC/THCResponse.cuh
aten/THC/THCResponse.cuh
+2
-4
No files found.
aten/THC/THCPropose.cuh
View file @
11726e3d
...
@@ -25,11 +25,9 @@ __global__ void weightedProposeKernel(int64_t *color, int64_t *prop, int64_t *ro
...
@@ -25,11 +25,9 @@ __global__ void weightedProposeKernel(int64_t *color, int64_t *prop, int64_t *ro
KERNEL_LOOP
(
i
,
nNodes
)
{
KERNEL_LOOP
(
i
,
nNodes
)
{
if
(
color
[
i
]
!=
-
1
)
{
continue
;
}
// Only visit blue nodes.
if
(
color
[
i
]
!=
-
1
)
{
continue
;
}
// Only visit blue nodes.
ptrdiff_t
c
;
bool
isDead
=
true
;
ptrdiff_t
c
;
bool
isDead
=
true
;
T
maxWeight
,
tmp
;
T
maxWeight
=
ScalarConvert
<
int
,
T
>::
to
(
0
)
,
tmp
;
int64_t
matchedValue
;
int64_t
matchedValue
=
-
1
;
for
(
ptrdiff_t
e
=
cumDegree
[
i
]
-
degree
[
i
];
e
<
cumDegree
[
i
];
e
++
)
{
for
(
ptrdiff_t
e
=
cumDegree
[
i
]
-
degree
[
i
];
e
<
cumDegree
[
i
];
e
++
)
{
maxWeight
=
ScalarConvert
<
int
,
T
>::
to
(
0
);
matchedValue
=
-
1
;
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.
...
@@ -39,12 +37,11 @@ __global__ void weightedProposeKernel(int64_t *color, int64_t *prop, int64_t *ro
...
@@ -39,12 +37,11 @@ __global__ void weightedProposeKernel(int64_t *color, int64_t *prop, int64_t *ro
maxWeight
=
tmp
;
maxWeight
=
tmp
;
}
}
}
}
if
(
matchedValue
>=
0
)
{
prop
[
i
]
=
matchedValue
;
}
prop
[
i
]
=
matchedValue
;
if
(
isDead
)
{
color
[
i
]
=
i
;
}
// Mark node as dead.
if
(
isDead
)
{
color
[
i
]
=
i
;
}
// Mark node as dead.
}
}
}
}
void
THCTensor_propose
(
THCState
*
state
,
THCudaLongTensor
*
color
,
THCudaLongTensor
*
prop
,
void
THCTensor_propose
(
THCState
*
state
,
THCudaLongTensor
*
color
,
THCudaLongTensor
*
prop
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaLongTensor
*
cumDegree
)
{
THCudaLongTensor
*
cumDegree
)
{
...
...
aten/THC/THCResponse.cuh
View file @
11726e3d
...
@@ -28,11 +28,9 @@ __global__ void weightedResponseKernel(int64_t *color, int64_t *prop, int64_t *r
...
@@ -28,11 +28,9 @@ __global__ void weightedResponseKernel(int64_t *color, int64_t *prop, int64_t *r
KERNEL_LOOP
(
i
,
nNodes
)
{
KERNEL_LOOP
(
i
,
nNodes
)
{
if
(
color
[
i
]
!=
-
2
)
{
continue
;
}
// Only visit red nodes.
if
(
color
[
i
]
!=
-
2
)
{
continue
;
}
// Only visit red nodes.
ptrdiff_t
c
;
bool
isDead
=
true
;
ptrdiff_t
c
;
bool
isDead
=
true
;
T
maxWeight
,
tmp
;
T
maxWeight
=
ScalarConvert
<
int
,
T
>::
to
(
0
)
,
tmp
;
ptrdiff_t
matchedValue
;
ptrdiff_t
matchedValue
=
-
1
;
for
(
ptrdiff_t
e
=
cumDegree
[
i
]
-
degree
[
i
];
e
<
cumDegree
[
i
];
e
++
)
{
for
(
ptrdiff_t
e
=
cumDegree
[
i
]
-
degree
[
i
];
e
<
cumDegree
[
i
];
e
++
)
{
maxWeight
=
ScalarConvert
<
int
,
T
>::
to
(
0
);
matchedValue
=
-
1
;
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment