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
9a1f7817
Commit
9a1f7817
authored
Apr 07, 2018
by
rusty1s
Browse files
clean up
parent
e6638edd
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
86 deletions
+0
-86
torch_cluster/src/serial_cpu.c
torch_cluster/src/serial_cpu.c
+0
-39
torch_cluster/src/serial_cpu.h
torch_cluster/src/serial_cpu.h
+0
-9
torch_cluster/src/serial_cuda.c
torch_cluster/src/serial_cuda.c
+0
-29
torch_cluster/src/serial_cuda.h
torch_cluster/src/serial_cuda.h
+0
-9
No files found.
torch_cluster/src/serial_cpu.c
deleted
100644 → 0
View file @
e6638edd
#include <TH/TH.h>
#define cluster_(NAME) TH_CONCAT_4(cluster_, NAME, _, Real)
#define SERIAL(output, row, col, degree, SELECT) { \
int64_t *output_data = output->storage->data + output->storageOffset; \
int64_t *row_data = row->storage->data + row->storageOffset; \
int64_t *col_data = col->storage->data + col->storageOffset; \
int64_t *degree_data = degree->storage->data + degree->storageOffset; \
\
int64_t e = 0, row_value, col_value, v; \
while(e < THLongTensor_nElement(row)) { \
row_value = row_data[e]; \
if (output_data[row_value] < 0) { \
col_value = row_value; \
SELECT \
v = row_value < col_value ? row_value : col_value; \
output_data[row_value] = v; \
output_data[col_value] = v; \
} \
e += degree_data[row_value]; \
} \
}
void
cluster_serial
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
)
{
int64_t
d
,
c
;
SERIAL
(
output
,
row
,
col
,
degree
,
for
(
d
=
0
;
d
<
degree_data
[
row_value
];
d
++
)
{
// Iterate over neighbors.
c
=
col_data
[
e
+
d
];
if
(
output_data
[
c
]
<
0
)
{
// Neighbor is unmatched.
col_value
=
c
;
break
;
}
}
)
}
#include "generic/serial_cpu.c"
#include "THGenerateAllTypes.h"
torch_cluster/src/serial_cpu.h
deleted
100644 → 0
View file @
e6638edd
void
cluster_serial
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
);
void
cluster_serial_Float
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THFloatTensor
*
weight
);
void
cluster_serial_Double
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THDoubleTensor
*
weight
);
void
cluster_serial_Byte
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THByteTensor
*
weight
);
void
cluster_serial_Char
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THCharTensor
*
weight
);
void
cluster_serial_Short
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THShortTensor
*
weight
);
void
cluster_serial_Int
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THIntTensor
*
weight
);
void
cluster_serial_Long
(
THLongTensor
*
output
,
THLongTensor
*
row
,
THLongTensor
*
col
,
THLongTensor
*
degree
,
THLongTensor
*
weight
);
torch_cluster/src/serial_cuda.c
deleted
100644 → 0
View file @
e6638edd
#include <THC/THC.h>
#include "serial.h"
#define cluster_(NAME) TH_CONCAT_4(cluster_, NAME, _cuda_, Real)
#define cluster_kernel_(NAME) TH_CONCAT_4(cluster_, NAME, _kernel_, Real)
extern
THCState
*
state
;
void
cluster_serial_cuda
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
)
{
int
bla
=
assignColor
(
state
,
output
);
printf
(
"RETURN TYPE IS %i
\n
"
,
bla
);
/* cluster_serial_kernel(state, output, row, col, degree); */
}
#include "generic/serial_cuda.c"
#include "THCGenerateFloatType.h"
#include "generic/serial_cuda.c"
#include "THCGenerateDoubleType.h"
#include "generic/serial_cuda.c"
#include "THCGenerateByteType.h"
#include "generic/serial_cuda.c"
#include "THCGenerateCharType.h"
#include "generic/serial_cuda.c"
#include "THCGenerateShortType.h"
#include "generic/serial_cuda.c"
#include "THCGenerateIntType.h"
#include "generic/serial_cuda.c"
#include "THCGenerateLongType.h"
torch_cluster/src/serial_cuda.h
deleted
100644 → 0
View file @
e6638edd
void
cluster_serial_cuda
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
);
void
cluster_serial_cuda_Float
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaTensor
*
weight
);
void
cluster_serial_cuda_Double
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaDoubleTensor
*
weight
);
void
cluster_serial_cuda_Byte
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaByteTensor
*
weight
);
void
cluster_serial_cuda_Char
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaCharTensor
*
weight
);
void
cluster_serial_cuda_Short
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaShortTensor
*
weight
);
void
cluster_serial_cuda_Int
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaIntTensor
*
weight
);
void
cluster_serial_cuda_Long
(
THCudaLongTensor
*
output
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
degree
,
THCudaLongTensor
*
weight
);
Prev
1
2
Next
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